can someone tell me whats wrong with this code? i'm running windows 8.1 with latest updates, excel 365, and have MySQL ODBC 3.51 Driver loaded on my computer and all are verified with current version.
when i get to the last line, i get a run time error 3706.
yes i have the correct server, db_name, user and password
Sub connectDB()
Dim oConn, oRs
Dim qry, connectstr
Dim db_name, db_username, db_userpassword
Dim db_server
If ActiveSheet.Range("$B$24").Value <> "" Then
db_server = ""
db_name = ""
db_username = ""
db_userpassword = ""
connectstr = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=; PORT=3306;" & "DATABASE=; USER=; PASSWORD=; OPTION=3;"
Dim strFirstName As String
Dim strLastName As String
Dim strEmailAddress As String
Dim intIsActive As Integer
Dim intAgreed As Integer
Dim strExpiration As String
With ActiveSheet
strFirstName = ActiveSheet.Range("$B$12")
strLastName = ActiveSheet.Range("$D$12")
strEmail = ActiveSheet.Range("$B$24")
intIsActive = 1
intAgreed = 1
strExpiration = Format(ActiveSheet.Range("$A$100").Value + 365, "yyyy-mm-dd")
End With
Set oRs = CreateObject("ADODB.Recordset")
Set oConn = CreateObject("ADODB.Connection")
oConn.Open connectstr
when i get to the last line, i get a run time error 3706.
yes i have the correct server, db_name, user and password
Sub connectDB()
Dim oConn, oRs
Dim qry, connectstr
Dim db_name, db_username, db_userpassword
Dim db_server
If ActiveSheet.Range("$B$24").Value <> "" Then
db_server = ""
db_name = ""
db_username = ""
db_userpassword = ""
connectstr = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=; PORT=3306;" & "DATABASE=; USER=; PASSWORD=; OPTION=3;"
Dim strFirstName As String
Dim strLastName As String
Dim strEmailAddress As String
Dim intIsActive As Integer
Dim intAgreed As Integer
Dim strExpiration As String
With ActiveSheet
strFirstName = ActiveSheet.Range("$B$12")
strLastName = ActiveSheet.Range("$D$12")
strEmail = ActiveSheet.Range("$B$24")
intIsActive = 1
intAgreed = 1
strExpiration = Format(ActiveSheet.Range("$A$100").Value + 365, "yyyy-mm-dd")
End With
Set oRs = CreateObject("ADODB.Recordset")
Set oConn = CreateObject("ADODB.Connection")
oConn.Open connectstr