0

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()

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by Teme64
Featured Replies
  • 1

    Didn't test it but if I remember right [CODE=VB.NET]oledbcom.CommandText = ("INSERT INTO Customer Company, Address, Telephone values ?,?,?")[/CODE]should be [CODE=VB.NET]oledbcom.CommandText = ("INSERT INTO Customer (Company, Address, Telephone) values (?,?,?)")[/CODE] HTH Read More

1

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

0

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.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.