Bug #70834 Error for fetching values from TEXT field
Submitted: 6 Nov 2013 13:51 Modified: 6 Nov 2013 16:01
Reporter: Rafael Caesar Lenzi Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:5.2.6 OS:Windows
Assigned to: CPU Architecture:Any

[6 Nov 2013 13:51] Rafael Caesar Lenzi
Description:
Using mysql-connector-odbc-5.2.6-win32 on a MS VBA project, when use a TEXT field in database, the ODBC return null value in text fields at the second field use.

How to repeat:
Using mysql-connector-odbc-5.2.6-win32 on a MS VBA project, when will use a TEXT field in database, the ODBC return null value and cause error on program.

How to repeat:
Create a VBA excel project, insert a simple module, add Microsoft ADO 2.8 reference and use the following function:

Public Function MyODBCConnectionTest()
    Dim myConnection As New ADODB.Connection
    
    myConnection.Open "DRIVER={MySQL ODBC 5.2 ANSI DRIVER};Server=server;DB=database;User=username;Password=password;"
    
    Dim myCommand As New ADODB.Command, myRecordset As ADODB.Recordset
    
    myCommand.ActiveConnection = myConnection
    myCommand.CommandText = "SELECT * FROM testtable;"
    Set myRecordset = myCommand.Execute
    
    MsgBox "Test1: " & myRecordset!Name 'Text showed ok here
    MsgBox "Test2: " & myRecordset!Name 'Doesnt show the row value
End Function

Table definition:
CREATE TABLE `testtable` (
  `name` text
) ENGINE=InnoDB charset latin1;

Mysql server version: 5.5.23 MySQL Community Server (GPL)
[6 Nov 2013 13:52] Rafael Caesar Lenzi
Example file

Attachment: MySQL test2.xls (application/vnd.ms-excel, text), 30.00 KiB.

[6 Nov 2013 16:01] MySQL Verification Team
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments to the original bug instead.

Thank you for your interest in MySQL.

Duplicate of http://bugs.mysql.com/bug.php?id=70765 .