Hi
I have access database with two tables With a Relationship i can insert records into the first table with no problems but when im trying to insert a record in the second table i got error message
Error message : Syntax error in INSERT INTO statement. - Microsoft Office Access Database
Second Table Name : Orders
Column Name of the second table : OrdersID
OrdersID Datatype : Numbers
Code :
Dim Connection As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source='" & My.Settings.report & "';" & "Persist Security Info=False;" & "Jet OLEDB:Database Password=" & ";")
Dim IDnum As String = "4"
Dim insertCommands As New OleDb.OleDbCommand("INSERT INTO Orders (OrdersID) VALUES ('" & IDnum & "')", Connection)
Try
Connection.Open()
insertCommanddss.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show(ex.Message & " - " & ex.Source)
Finally
Connection.Close()
End Try
The Same Code Works perfectly on the First table
So Whats Wrong ?!
thanks