Bug #33825 MyODBC 51/Access unable to use DBEngine.RegisterDatabase to create a DSN
Submitted: 11 Jan 2008 19:40 Modified: 28 Mar 2008 18:20
Reporter: Erica Moss Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:5.1.1 OS:Microsoft Windows (XP sp2)
Assigned to: Jess Balint CPU Architecture:Any
Tags: regression

[11 Jan 2008 19:40] Erica Moss
Description:
When this code is run against MyODBC 3.51.23 a DSN is successfully created.  The same code run against 5.1.1 results in an error:

error #3146:ODBC--call failed.

How to repeat:
1. open the attached mdb file and edit the module file changing the password
2. variable to the one that is correct for the local mysql installation.
3. open the form "CREATE_DSN"
4. click the button "Create 5.1 DSN" to run the following subroutine...

Public Function Create51DSN()
    On Error GoTo ERR
    strDBname = "northwind"
    strServer = "localhost"
    strPW = "password"
    strUName = "root"
    str51Driver = "MySQL ODBC 5.1 Driver"
    strDSN = "Access 5.1 Test"
    
    Dim strAttrib As String
    strAttrib = "DESCRIPTION=Access Compatibility test" & Chr$(13) & _
            "DATABASE=" & strDBname & Chr$(13) & _
            "UID=" & strUName & Chr$(13) & _
            "PWD=" & strPW & Chr$(13) & _
            "SERVER=" & strServer
            
    Call DBEngine.RegisterDatabase(strDSN, str51Driver, True, strAttrib)
    
    Exit Function
      
ERR:
    MsgBox "error #" & ERR.Number & ":" & ERR.Description
End Function
[11 Jan 2008 19:41] Erica Moss
access database file

Attachment: DSN bug.mdb (application/msaccess, text), 176.00 KiB.

[11 Jan 2008 20:19] Jess Balint
fix NULL handling in ConfigDSN, dont show GUI unless needed and allow ODBC_DSN_ADD with attributes given

Attachment: bug33825.diff (application/octet-stream, text), 1.52 KiB.

[17 Mar 2008 19:12] Jess Balint
Committed as rev 1075 and will be released in 5.1.3.
[28 Mar 2008 18:20] MC Brown
A note has been added to the 5.1.3 changelog: 

Microsoft Access would be unable to use DBEngine.RegisterDatabase to create a DSN using the Connector/ODBC driver.
[29 Jan 2009 22:33] Jess Balint
bug#41796 is a regression of this