MySQL Forums
Forum List  »  Connector/ODBC

ODBC 5.1 driver returns wrong datatype to ADODB
Posted by: Ryan Griggs
Date: May 04, 2016 03:24PM

0
down vote
favorite


Situation: working with legacy classic ASP code, attempting to move the codebase from an old server to a new one.

The code attempts to connect to a MySQL database on a Windows server using the MySQL ODBC 5.1 driver and the ADODB.Connection object.

Connection String = "Driver={MySQL ODBC 5.1 Driver};Server=dbserver;Database=dbname;Uid=username;Password=password;Option=3"

Query results are returned in ADODB.RecordSet objects. When I try to access a field containing a standard MySQL Integer, I get this error:

Microsoft VBScript runtime error '800a01ca'
Variable uses an Automation type not supported in VBScript

If I manually convert the field using cLng() then the error is eliminated and the correct value is returned. However, there is too much code to manually look for each reference to an integer and manually convert it.

VarType() returns 19 for these values, which appears to be some type of Long datatype that VB doesn't understand. (See here) Isn't the ODBC driver supposed to return VarType 3 for long integers? (see here)

I tried passing the option 16384 (NO_BIGINT) in the "option=" parameter of the connection string but it didn't make any difference.

Any idea how to correct this? It seems there should be an option to pass to the MySQL ODBC driver to return longs as Long Integer datatype, but I can't find it.

Thanks in advance!

Options: ReplyQuote


Subject
Written By
Posted
ODBC 5.1 driver returns wrong datatype to ADODB
May 04, 2016 03:24PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.