I just upgraded to MySQL Connector/ODBC 5.2 from 5.1 and now my db connections don't work as I have wrong driver text in my functions. I've gone to their site and Googled for it but I cannot find it. Does anyone know what the new driver string is?
This is the code I used successfully before, I need a new DRIVER string for version 5.2. Any help appreciated
This is the code I used successfully before, I need a new DRIVER string for version 5.2. Any help appreciated
Code:
Public Sub ConnectDB(server As String, user As String, password As String, Optional Database As String, Optional testmode As Boolean)
On Error GoTo ErrHandler
Set oConn = New ADODB.Connection
oConn.Open "DRIVER={MySQL ODBC 5.1 Driver};" & _
"SERVER=" & server & ";" & _
"DATABASE=" & Database & ";" & _
"USER=" & user & ";" & _
"PASSWORD=" & password & ";" & _
"Option=3"
If testmode = True Then
MsgBox "Database Connection Test Successful!", vbInformation, "Success!"
'cmdInsertData.Enabled = True
End If
Exit Sub
ErrHandler:
MsgBox Err.Description, vbCritical, Err.Source
End Sub