Description:
When reading DECIMAL (with 12,2) column from mySQL 5.0.4 i receiving this
message error:
Run-Time error -2147217887 (80040e21)
Multiple-step OLE DB operation generated errors. Check each OLE DB status value,
if available. No work was done.
I use Microsoft Visual Basic 6 SP6, MDAC 2.8, with myODBC 3.51.11-2.
The read and write is fine with the VARCHAR, TEXT and others data types.
I tested and the problem with DECIMAL does not occur with the mySQL 4.0.24.
I use this connection string:
Driver={MySQL ODBC 3.51 Driver};Server=xxx.xxx.xxx.xxx;
Port=3306;Database=xxxxxx;UID=xxxx;PWD=xxxx;Option=16427;
How to repeat:
Read any column of data type DECIMAL (12,2 in this case, i not tested with
othes)
Example of code:
Dim conn As New ADODB.Connection
Dim strConn As String
strConn = "Driver={MySQL ODBC 3.51
Driver};Server=localhost;Port=3306;Database=xxxx;UID=xxxx;PWD=xxxx;Option=16427"
conn.Open strConn
Dim SQLDB As New ADODB.Recordset
Dim StrDB As String
StrDB = "select name,points from tablename where idcode=10"
SQLDB.Open StrDB, conn
If Not (SQLDB.BOF And SQLDB.EOF) Then
txtname.text = SQLDB("name") 'fine at this point, name is CHAR
txtpoints.text = SQLDB("points") 'error at this line, points is DECIMAL
end if
SQLDB.close
set SQLDB=nothing
conn.close
set conn=nothing
Suggested fix:
I unknow the specific origin of problem, mySQL, myODBC or others.