mysqlvbaodbc

odbc driver does not support the requested properties


odbc driver does not support the requested properties error come when we run the program at last line can anyone please give me idea.

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

Solution

  • Try This:-

    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