Bug #35316 Insert using ODBC generates an extra period (.) between database name and table
Submitted: 16 Mar 2008 7:25 Modified: 29 May 2013 6:15
Reporter: Phil Dobber Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:03.51.23 OS:Windows (98)
Assigned to: Bogdan Degtyariov CPU Architecture:Any
Tags: insert, malformed SQL, ODBC, VB6

[16 Mar 2008 7:25] Phil Dobber
Description:
Using ADODC control generates the following error irrespective of server (Don't have problem on XP environment with the same VB code, or when pointing the same DSN to mysqld server on XP version.

ODBC appears to generate the following SQL:
INSERT INTO `db_name`..`table_name` (`FLD1`,`FLD2`) VALUES ('Val1','Val2');

containing an extra period(.) which quite properly returns an error as follows:-
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.`sys
_statii` (`NAME`,`DESCR`) values ('asd','qwe')' at line 1

Connector/ODBC Debug Log file as follows:

-- Query logging
--
--  Driver name: MySQL ODBC 3.51 Driver  Version: 03.51.23
-- Timestamp: 080316 15:26:25

select NAME,DESCR from sys_statii;
INSERT INTO `mreqdev`..`sys_statii` (`NAME`,`DESCR`) VALUES ('dtryu','tryrty');

How to repeat:
Use VB6 Application Wizard to create an ADODC based Data Form to connect to a mySQL table OR a CLASS-based Data Form 

both will fail because Connector seems to add an extra period (.) as described

Suggested fix:
Remove the extra . (but I am sure you already guessed this !)
[17 Mar 2008 8:44] Tonci Grgin
Hi Phil and thanks both for your report and kind words. Can you please attach test case (so I can see your connect string) and DM trace file (so I can guess what's happening)?
[17 Apr 2008 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[29 May 2013 6:15] Bogdan Degtyariov
I'm closing this bug because I can not continue without feedback from the reporter. If you have new info, please reopen the report.