Bug #26610 MyODBC ADO Default Database, and Current Catalog properties not assigned
Submitted: 23 Feb 2007 23:03 Modified: 7 Nov 2007 12:29
Reporter: Erica Moss Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:5.0.12 2/22 OS:Windows (win xp)
Assigned to: CPU Architecture:Any

[23 Feb 2007 23:03] Erica Moss
Description:
This problem was discovered running ADO compliance test cndefdat.vbs.TestExecuteValid()

If either this testcase, or the VB function below are run against MyODBC 3.51, the "Current Catalog" property node is found in the connection.Properties collection, and the Default Database property are both assigned correctly to the database specified in the connection string.

When run against MyODBC 5.0 neither value is populated, and an error is thrown when attempting to access the Default Database property:
"Provider does not support the property."

How to repeat:
FIRST:
mysql> CREATE DATABASE ad0;

NEXT:
Option Explicit
Dim strSQL As String
Dim strConn As String
Dim oConn As adodb.Connection
Dim prop As Variant

Private Sub Test()
On Error GoTo EH
    Set oConn = New adodb.Connection
    Set oRs = New adodb.Recordset
    strSQL = "select 1"

'    strConn = "DRIVER={MySQL ODBC 3.51 Driver};" & _
        "SERVER=localhost;DATABASE=ado" & _
        ";USER=root;PASSWORD=mypass;OPTION=3;"
   strConn = "DRIVER={MySQL Connector/ODBC v5};" & _
        "SERVER=localhost;DATABASE=ado" & _
        ";UID=root;PWD=mypass;OPTION=3;"
    
    oConn.ConnectionString = strConn
    oConn.CursorLocation = adUseClient
    oConn.Open
    
    For Each prop In oConn.Properties
        If prop.Name = "Current Catalog" Then
            MsgBox "found it"
            Exit For
        End If
    Next

    MsgBox oConn.DefaultDatabase ' FAILS HERE WITH MYODBC 5.0
    MsgBox oConn.Properties("Current Catalog")
    Exit Sub
EH:
    MsgBox Err.Number & ":" & Err.Description
    
End Sub
[31 Oct 2007 22:13] Erica Moss
Tested against MyODBC 3.51.20, and 5.1.0  Problem is resovled

Testcase added to script unit ADO conformance test suite
ado-compliance\trunk\bugs\26610.vbs
[7 Nov 2007 12:29] Susanne Ebrecht
Eric,

because the issue here don't occur MyODBC v5.1, I'll close this bug now.

Many thanks,

Susanne