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
double quotes and Invalid Table Name ''
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