Bug #10293 Run-time error -2147217887 (VB6) when reading DECIMAL column from mySQL 5.0.4
Submitted: 1 May 2005 17:18 Modified: 1 May 2005 18:12
Reporter: Luis A S Junior Camargo Email Updates:
Status: Can't repeat Impact on me:
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.4 OS:Windows (Windows 2000 Server SP4)
Assigned to: CPU Architecture:Any

[1 May 2005 17:18] Luis A S Junior Camargo
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;

How to repeat:
Read any column of data type DECIMAL (12,2 in this case, i not tested with

Example of code:

Dim conn As New ADODB.Connection
Dim strConn As String

strConn = "Driver={MySQL ODBC 3.51

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

   txtname.text = SQLDB("name")   'fine at this point, name is CHAR
   txtpoints.text = SQLDB("points")  'error at this line, points is DECIMAL
end if

set SQLDB=nothing

set conn=nothing

Suggested fix:
I unknow the specific origin of problem, mySQL, myODBC or others.
[3 Nov 2005 20:08] Andrew Arnold
I had a similar problem and resolved it by using a newer version of ADO (v2.8).