Jihadalariqi Level: Protégé
 Registered: 18-12-2007 Posts: 4
|
Re: Connecting to mySQL
you can use code like this
Dim Cn As ADODB.Connection
Dim Rs As ADODB.Recordset
Private Sub cmdConnect_Click()
Set Cn = New ADODB.Connection
Cn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
& "SERVER=" & txtHost.Text & ";" _
& "DATABASE=" & txtDB.Text & ";" _
& "UID=" & txtUser.Text & ";" _
& "PWD=" & txtPass.Text & ";" _
& "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 16384
Cn.CursorLocation = adUseClient
Cn.Open
MsgBox "Connected"
End Sub
|
and this link for connectionstring with any DB
http://www.connectionstrings.com/
____________________________
vbboy
|