ODBC Connector 5.1.5 'text' field insert failure
Кирилл Фомичев <[email protected]> Wed, 29 Jul 2009 17:22:00 +0400
| Newsgroups | gmane.comp.db.mysql.odbc |
|---|---|
| Organization | Империя кадров |
| Message-ID | <[email protected]> |
Hello. I'm using OBDC Connector 5.1.5 with MS Visual Basic 6 / ADO 2.8 When I add a new record to and ADODB Recordset and try to assign a value to a field of 'TEXT' type no data actually is being inserted. Furthermore, if this field doesn't allow nulls, and error encounters. The steps to reproduce the problem. 1. Sample MySQL table CREATE TABLE `TestTable` ( `PK` int(11) NOT NULL AUTO_INCREMENT, `chrField` varchar(255) COLLATE utf8_general_ci NOT NULL, `txtField` text COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (`PK`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci AUTO_INCREMENT=1 2. VB6 code (referencing ADO 2.8) Dim Con As New ADODB.Connection Dim Rst As New ADODB.Recordset Con.Open "DSN=MySQL DSN" Con.Execute "DELETE FROM TestTable" 'Emptying test table for convenience Rst.Open "SELECT * FROM TestTable", Con, adOpenDynamic, adLockOptimistic Rst.AddNew Rst!chrField = "TEST CHRFIELD" Rst!txtField = "TEST TXTFIELD" Rst.Update Rst.Close Con.Close 3. I'm not able to get ODBC trace, maybe something's broken :O BUT I can get the Connector debug log. The actual SQL statements in the log are following: DELETE FROM TestTable; SELECT * FROM TestTable; INSERT INTO `TestTable`(`PK`,`chrField`,`txtField`) VALUES (DEFAULT,'TEST CHRFIELD',NULL); As you can see in the INSERT query, the value "TEXT TXTFIELD" as absent and replaced with NULL by the driver. I suppose this surely is a bug. Or maybe not? Please help. Additional info: 1. The ODBC Connector 3.51 works OK with the same VB code. 2. Trying Con.Execute "INSERT INTO `TestTable`(`PK`,`chrField`,`txtField`) VALUES (DEFAULT,'TEST CHRFIELD','TEST TXTFIELD');" works OK. 3. The same table works fine when linked to an Access database through the same DSN. Versions: MySQL Server: 5.1.28-rc-log Driver name: MySQL ODBC 5.1 Driver Version: 05.01.0005 ODBC Manager: 3.525.1117.0 Windows XP SP3 Visual Basic: 6.0.9782 (SP6) Best regards, Kyrill. -- MySQL ODBC Mailing List For list archives: http://lists.mysql.com/myodbc To unsubscribe: http://lists.mysql.com/[email protected]