i just found this having the same problem
i dont know if u already found it if you do i would like to know how u did it
i am currently using this code for a sql.. which needs to be changed to a mysql code :)
Public Sub conectarse()
Set BdSQL = New ADODB.Connection
Set BdSQL = New ADODB.Connection
BdSQL.ConnectionString = "DRIVER={SQL Server}; " & _
"SERVER=pcpaola; " & _
"UID=XXXXX;" & _
"PWD=XXXXX"
BdSQL.Open
BdSQL.DefaultDatabase = "aduana"
If BdSQL.State = adStateClosed Then
BdSQL.Open BdSQL.ConnectionString
End If
If BdSQL.State = 1 Then
conectado = True
Else
conectado = False
MsgBox "Hubo un Error, No se pudo conectar al Servidor... Consulte con un Administrador", vbCritical
End If
End Sub
The code i found but didnt use is can be found on
http://www.vbmysql.com/mike/blog/archives/000001.php