odbc驱动程序不支持所请求的属性

时间:2014-08-08 09:28:04

标签: mysql vba odbc

odbc驱动程序不支持所请求的属性错误,当我们在最后一行运行程序时,任何人都可以给我一个想法。

Dim conn As New ADODB.Connection
Dim rsRec As ADODB.Recordset
Dim cmd As ADODB.Command
Dim query As String

Set conn = New ADODB.Connection
Set rsRec = New ADODB.Recordset

conn.connectionString = "DRIVER={MySQL ODBC 3.51 Driver}; Server=127.0.0.1 ;Database=try;User=root;Password=root;"

conn.Open

query = "INSERT INTO user_table (Name)"
query = stSQL & "VALUES (Anupam)"

rsRec.Open query, conn, adOpenDynamic, adLockOptimistic

1 个答案:

答案 0 :(得分:1)

试试这个: -

Dim conn As New ADODB.Connection
Dim rsRec As ADODB.Recordset
Dim cmd As ADODB.Command
Dim query As String

Set conn = New ADODB.Connection
Set rsRec = New ADODB.Recordset

conn.connectionString = "DRIVER={MySQL ODBC 3.51 Driver}; Server=127.0.0.1 ;Database=try;User=root;Password=root;"

conn.Open

query = "INSERT INTO user_table (Name) VALUES (Anupam)"

rsRec.Open query, conn, adOpenDynamic, adLockOptimistic