
Evaldas
|
| Posted: 08/29/2002, 4:38 AM |
|
Hello, I'm just starting with CodeCharge Studio and there are some problems while trying to connect to SAP DB database via ODBC interface.
I made a simple database (contact book), created DSN on the server and on the computer which I'm working on. ODBC works fine because I successfully connected to my database using simple application which uses ODBC interface.
Then I generated project with CodeCharge Studio (PHP4). It does connect to the database and I see few entries in it but when I try to add a record I get error message like this:
--------------------
Warning: SQL error: [SAP AG][SQLOD32 DLL][SAP DB]General error;-3009 POS(13) Message not available., SQL state S1000 in SQLExecDirect in C:\wwwklientai\db_odbc.php on line 80
Database error: Invalid SQL: INSERT INTO [CUSTOMER] ([NAME], [EMAIL], [PHONE], [FAX], [ADDRESS]) VALUES ('Peter Smith', 'peter@peter.com', '1111111111', '1111111112', 'Roseland Av. 5214')
ODBC Error: 1 (General Error (The ODBC interface cannot return detailed error messages).)
Session halted.
--------------------
Line 80 on db_odbc.php looks like that:
$this->Query_ID = odbc_exec($this->Link_ID,$Query_String);
Server software: W2K Server (IIS), PHP 4.0.6 (ODBC enabled), SAP DB 7.4
Maybe somebody has some ideas? Thanks.
|
|
|
 |
Nicole
|
| Posted: 08/29/2002, 6:56 AM |
|
Evaldas,
go to CodeChargeStudio/Components/Database folder and edit
SQLServer.xml file - replace
fieldLeftDelim="["
fieldRightDelim="'"
with
fieldLeftDelim=""
fieldRightDelim=""
and see if it helps.
|
|
|
 |
Evaldas
|
| Posted: 08/29/2002, 8:39 AM |
|
Got the idea to remove [] from SQL query but I still get 'Invalid SQL' error. Even without the brackets.
|
|
|
 |
Nicole
|
| Posted: 08/30/2002, 12:11 AM |
|
Hello,
please try to rename "name" field and test sql against db. If it is successful, try it in CCS.
|
|
|
 |
Evaldas
|
| Posted: 08/30/2002, 4:53 AM |
|
Renaming did not help. But I noticed one important (I think so) thing. CodeCharge Studio doesn't allow to work with tables which doesn't have key field, so I made one key field. And in generated project this key field is not displayed in Add/Edit page. I don't understand why. And I think that wrong SQL query (without key field parameters) is being generated and that's why I get errors. Actually I'm totally new to SQL, PHP and stuff so maybe you have some thoughts about this?
|
|
|
 |
Nicole
|
| Posted: 08/30/2002, 6:12 AM |
|
Well, CCS expects each table to have primary key. As usual primary keys are autonumbers, so their values are generated automatically when record is inserted. Moreover there’s no need to change their values when record is updated. That’s why they are not displayed on the record form.
I suggest you to use autoincrement primary key (in SQL server mark key as identical).
|
|
|
 |
Nicole
|
| Posted: 08/30/2002, 6:12 AM |
|
Well, CCS expects each table to have primary key. As usual primary keys are autonumbers, so their values are generated automatically when record is inserted. Moreover there’s no need to change their values when record is updated. That’s why they are not displayed on the record form.
I suggest you to use autoincrement primary key (in SQL server mark key as identical).
|
|
|
 |
Evaldas
|
| Posted: 09/02/2002, 4:31 AM |
|
Thank you! I inserted a autoncrement column to the database and everything works fine now.
|
|
|
 |
|

|