dmikester1
10-03-2014, 08:54 AM
This is probably very simple, but I have very little experience in VBA coding.
I am getting a syntax error, and it highlights the second line. Any ideas why?
Dim oConn As ADODB.Connection
Private Sub ConnectDB()
Set oConn = New ADODB.Connection
oConn.Open "DRIVER={MySQL ODBC 5.1 Driver};" & _
"SERVER=xxx;" & _
"DATABASE=xxx;" & _
"USER=xxx;" & _
"PASSWORD=xxx;" & _
"Option=3"
End Sub
I am getting a syntax error, and it highlights the second line. Any ideas why?
Dim oConn As ADODB.Connection
Private Sub ConnectDB()
Set oConn = New ADODB.Connection
oConn.Open "DRIVER={MySQL ODBC 5.1 Driver};" & _
"SERVER=xxx;" & _
"DATABASE=xxx;" & _
"USER=xxx;" & _
"PASSWORD=xxx;" & _
"Option=3"
End Sub