I normally use SQL as the backend database however for a new project I need to use MSAccess.
I am trying to insert a new record, this works fine if I only have on fielid on the row but as soon as I have a second field I get an error.
"Syntax error in INSERT INTO statement."
can anyone point me in the right direction?
Dim sql As String = "INSERT INTO TblReelResults (ID , Section) VALUES(@ID ,@Section)"
Using conn = New System.Data.OleDb.OleDbConnection(_connectionstring)
Using sqlCom = New System.Data.OleDb.OleDbCommand(sql, conn)
conn.Open()
sqlCom.Parameters.Add("@ID", OleDbType.VarWChar).Value = Me.lb_id.Text
sqlCom.Parameters.Add("@Section", OleDbType.VarWChar).Value = Me.txtSection.Text
Dim icount As Integer = sqlCom.ExecuteNonQuery
End Using
End Using