Bug #27864 MyODBC 5/ ADO RecordSet containing Decimal data type (adNumeric) won't update
Submitted: 17 Apr 2007 0:31 Modified: 22 Oct 2007 13:34
Reporter: Erica Moss Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:5.0.12 OS:Windows (XP sp 2)
Assigned to: CPU Architecture:Any

[17 Apr 2007 0:31] Erica Moss
Description:
Attempting to update a recordset containing a mysql Decimal data type (ADO type adNumeric) results in the following error:

[MySQL][MyODBC 5.00.12] unknown C data type 2 -2147467259

NOTE: This does not occur with MyODBC 3.51.14

How to repeat:
SETUP:
mysql> CREATE TABLE ado_test (C1 INT PRIMARY KEY, C2 DECIMAL(10));
mysql> INSERT INTO ado_test VALUES (1, 101), (2, 202);

VB code:
Private Sub Test()
    On Error GoTo EH
    Dim strSQL, strConn As String
    Dim connection1 As ADODB.Connection
    Dim recset1 As ADODB.Recordset
    Dim fld As Field
    Set connection1 = New ADODB.Connection
    Set recset1 = New ADODB.Recordset

    strSQL = "SELECT * FROM ado_test"
    strConn = "DRIVER={MySQL Connector/ODBC v5};" & _
            "SERVER=localhost;DATABASE=ado" & _
            ";UID=root;PWD=mypass;OPTION=3;"

    'open connection
    connection1.ConnectionString = strConn
    connection1.CursorLocation = adUseServer
    connection1.Open

    recset1.Open strSQL, connection1, adOpenForwardOnly, _
                 adLockOptimistic, adCmdText
             
    recset1.MoveFirst
    For Each fld In recset1.Fields
        If fld.Type = adNumeric Then
            fld.Value = fld.Value + 1
            recset1.Update
        End If
    Next
    Exit Sub

EH:
    Debug.Print Err.Description & " " & Err.Number & vbNewLine

End Sub
[22 Oct 2007 13:34] Susanne Ebrecht
This is a duplicate of bug #3028