Syntax error in INSERT INTO statement.,OLEDBEXCEPTION
-
Monday, April 16, 2012 1:56 PM
i am having trouble with the inserting of new values though the textboxes. it gives me the error Syntax error in INSERT INTO statement.,OLEDBEXCEPTION was unhandled at ---> da.Update(ds,"Doc"). Whereas there is no such insert into statement in my code.
Below is my code for Ms-Access dbase:
Private Sub btnCommit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCommit.Click
Dim cb As New OleDb.OleDbCommandBuilder(da)
Dim dsNewRow As DataRow
dsNewRow = ds.Tables("Doc").NewRow()
dsNewRow.Item("First Name") = First_NameTextBox.Text
dsNewRow.Item("Surname") = Last_NameTextBox.Text
ds.Tables("Doc").Rows.Add(dsNewRow)
da.Update(ds, "Doc")
MsgBox("New Record added to the Database")btnCommit.Enabled = False
btnAddNew.Enabled = True
End Sub- Changed Type HemangiL Monday, April 16, 2012 2:36 PM
All Replies
-
Tuesday, April 17, 2012 8:46 AMModerator
Hi HemangiL,
Thank you for posting in the MSDN forum.
I’m afraid that it is not the correct forum about this issue, since this forum is to discuss Visual Studio Debugger tool.
Based on your description, it seems that it is related to VB, if so, like this thread “Syntax error in INSERT INTO statement. OLEDBEXCEPTION was unhandled”, you could post it Visual Basic General for dedicated support. Thanks for your understanding.
Have a nice day,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us

