here is my code

Dim oledbcom As New OleDb.OleDbCommand
oledbcom.CommandText = ("INSERT INTO Customer Company, Address, Telephone values ?,?,?")
oledbcom.Connection = oledbcon

Dim oledbparam As OleDb.OleDbParameter = _
oledbcom.Parameters.Add("@Company", OleDb.OleDbType.VarChar, 30)
oledbparam.Value = txtCompName.Text.Trim()

oledbparam = oledbcom.Parameters.Add("@Address", OleDb.OleDbType.VarChar, 80)
oledbparam.Value = txtAddress.Text.Trim

oledbparam = oledbcom.Parameters.Add("@Telephone", OleDb.OleDbType.VarChar, 15)
oledbparam.Value = txtContact.Text.Trim

oledbcom.ExecuteNonQuery()

Didn't test it but if I remember right

oledbcom.CommandText = ("INSERT INTO Customer Company, Address, Telephone values ?,?,?")

should be

oledbcom.CommandText = ("INSERT INTO Customer (Company, Address, Telephone) values (?,?,?)")

HTH

Hi! Nice to hear that you got answer to your problem. Could you please mark the thread as solved. Thank you!

This question has already been answered. Start a new discussion instead.