Basically I've had the 'Syntax error in INSERT INTO statement' problem for the last couple of hours. I first was adding a new row into a dataset and then using a commandbuilder to update my database and that wasn't working. So I switched to doing a query as seen below without any datasets etc, but still getting the same problem.
The fields you see in the SQL statemenet are all those in the table, except for 'QuestionID' which is an autonumber found after the field 'Help'. Do I need to put it in my statement, if yes what value do i assign it??
But basically I can't see any reason why it isn't working?, someone on this site told me last time that 'Level' might cause some problems hence the use of [Level].
All the values being enetered are all correct format, and like mentioned above the autonumber 'questionid' is the only field not being included.
'updates database with new row with values. Dim cmd As New OleDb.OleDbCommand cmd.Connection = Con cmd.CommandText = "INSERT INTO Connect4Learning ([Level], Time, Question, CorrectAnswer, SingleorLine, Help, Language) " & _ "VALUES(" & LevelTxt.Text & ", " & 0 & ", " & QuestionTxt.Text & ", " & CorrectAnswer & ", " & SingleLineTxt.Text & ", " & _ HelpTxt.Text & ", " & LanguageTxt.Text & ")" MsgBox(cmd.CommandText) cmd.ExecuteNonQuery()
This post has been edited by KyleRose26: 25 March 2012 - 07:31 AM