I am trying to insert records using the code below.. I get an error message saying "must use an updatable query" can someone tell me whats wrong with the code?
Dim DBCommand As OleDb.OleDbDataAdapter
Dim DBInsert As New OleDb.OleDbCommand()
Dim dbconn As New OleDb.OleDbConnection( _
"Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=" & Server.MapPath("Database.mdb;")
DBInsert.CommandText = "INSERT INTO table(Field) VALUES ('" & txt.Text & "')"
DBInsert.Connection = dbconn
DBInsert.Connection.Open()
DBInsert.ExecuteNonQuery()
DBInsert.Connection.Close()
Thanks
Dim DBCommand As OleDb.OleDbDataAdapter
Dim DBInsert As New OleDb.OleDbCommand()
Dim dbconn As New OleDb.OleDbConnection( _
"Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=" & Server.MapPath("Database.mdb;")
DBInsert.CommandText = "INSERT INTO table(Field) VALUES ('" & txt.Text & "')"
DBInsert.Connection = dbconn
DBInsert.Connection.Open()
DBInsert.ExecuteNonQuery()
DBInsert.Connection.Close()
Thanks