|
测试vba连接mysql时报错,ODBC32位和64位都安装配置了,求解答。
Sub TestConnectTodb()
Dim SQLDriver$, SQLServerIP$, SQLServerPort$, SQLDataBase$, SQLu$, SQLpswd$, SQLOPTION$
Dim ADO_conn As ADODB.Connection
Dim ADO_rdst As ADODB.Recordset
Set ADO_conn = New ADODB.Connection '连接方式
Set ADO_rdst = New ADODB.Recordset
SQLDriver = "MySQL ODBC 5.3 Unicode Driver"
SQLOPTION = "3"
SQLServerIP = "*******"
SQLServerPort = "3306"
SQLu = "****"
SQLpswd = "****"
SQLDataBase = "mysql"
ADO_conn.ConnectionString = "Driver={" & SQLDriver & "};Server=" & SQLServerIP & ";Port=" & SQLServerPort & ";Database=" & SQLDataBase & ";Uid=" & SQLu & ";Pwd=" & SQLpswd & ";OPTION=" & SQLOPTION & ";"
ADO_conn.Open '建立远程连接...
End Sub
|
|