Bug #33825 MyODBC 51/Access unable to use DBEngine.RegisterDatabase to create a DSN
Submitted: 11 Jan 20:40 Modified: 28 Mar 19:20
Reporter: Eric MaLossi
Status: Closed
Category:Connector/ODBC Severity:S2 (Serious)
Version:5.1.1 OS:Microsoft Windows (XP sp2)
Assigned to: Jess Balint Target Version:
Tags: regression
Triage: D4 (Minor)

[11 Jan 20:40] Eric MaLossi
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 20:41] Eric MaLossi
access database file

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

[11 Jan 21: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 20:12] Jess Balint
Committed as rev 1075 and will be released in 5.1.3.
[28 Mar 19: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.