Page 1 of 1

Incorrect syntac nead the keyword 'User'

Posted: Thu 03 Mar 2005 10:34
by treierts
I have just changed from the standard Borland Delphi 2005 driver to the CoreLab dbExpress driver. My application compiles fine but I get the following error when opening the table "User" at runtime:

---------------------------
Error
---------------------------
Database Server Error: Incorrect syntax near the keyword 'User'
---------------------------
OK
---------------------------

This does not happen with the standard MSSQL driver. Is this a bug or is it my fault having designed a database with a table called "User". Since it works with the standard version I would assume that it should also work with the CoreLab driver.

Please advice.

Best Regards,

Tom Reiertsen

Additional information

Posted: Thu 03 Mar 2005 10:45
by treierts
Btw. I was using a TSQLTable component holding the "User" table. If I change this to a TSQLQuery componentn and do the following SQL it works:

SELECT * FROM "User"

Tom.

Posted: Fri 04 Mar 2005 12:04
by Ikar
It is a specific of MS SQL. On reference to User table its name must be quoted ("User").
TSQLTable doesn't support this specific and generates a query incorrect from the point of view of MS SQL ("SELECT * FROM User")

Posted: Fri 04 Mar 2005 12:11
by treierts
Yes, I realize that.

But in my original post I explain that the Borland driver works fine with this configuration while your driver does not. I am assuming that the Borland driver then *always* encloses the table name in "" chars.

Can you comment and further on this?

Posted: Sat 05 Mar 2005 14:04
by Ikar
You are right, standard driver always puts quote. Now we are considering a possibility of adding such functionality to DbxSda. On the one hand, a compatibility rises in the cases when key fields are used in TSQLTable as a name. On the other hand, a readability of the query text is reduced for the rest cases.