Page 1 of 1

double quotes and Invalid Table Name ''

Posted: Mon 09 Jul 2007 18:22
by eduardo
Hi all,

we have an application developed with Kylix 2 / midas and connected to MySQL 3.23 with Borland's drivers. Now we are upgrading our Debian systems and MySQL is at 4.1, so those drivers have stopped working. We've downloaded crlab.com drivers to test them out, and the good thing is that, after configuring dbxdrivers and dbxconnections, we can connect again to MySQL using libsqlmda.so.3.20, but the bad news is we still can not access MySQL table data - it seems the driver is adding two single quotes around table names in the queries it sends to the server.

In our application we have TDataSetProvider's linked to a TSQLClientDataSet's with CommandType = 'ctTable' and CommandText set to the table name of each table. Using DBMonitor, the query built and sent by the driver for a table 'Clients' to MySQL is 'select * from ``Clients``' (note the quotes around Clients), so MySQL reasonably returns error Invalid Table Name ''. We've used the UseQuoteChar option (set to false) as explained in the documentation, but the generated sql is the same.

What are we doing wrong in setting up the driver and the Kylix components?

TIA,

Eduardo

Posted: Tue 10 Jul 2007 08:46
by Antaeus
I created a default application using your explanation, but could not reproduce this problem. Please provide the code, or send me a complete small sample to evgeniyd*crlab*com, to demonstrate it.

Posted: Tue 10 Jul 2007 10:08
by eduardo
Hi Antaeus,

thank you for replying. I've just sent you a project with a minimal application that connects to test.test and, on my system, reproduces the described problem.

TIA,

Eduardo

Posted: Fri 13 Jul 2007 07:45
by Antaeus
Thank you for your sample. It reproduces the problem. Now we are working on it.
As soon as we have any results, we will let you know.

Posted: Wed 18 Jul 2007 07:30
by eduardo
Thank you for your replay Antaeus. I'll be watching this topic, since we depend on this issue to migrate our systems.

TIA

Eduardo

Posted: Tue 28 Aug 2007 09:52
by Antaeus
We have deeper investigated this problem. The reason of this problem is in dbExpress code. The query with double quoted table name is generated by dbExpress, and then passed to DbxMda. Unfortunately there is no appropriate solution to avoid this issue in the driver. You should use the SQLClientDataSet with the following parameters instead:

Code: Select all

 CommandText = 'select * from Clients'
 CommandType = ctQuery