database insertion - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


database insertion

i am failing to insert into an access using the following code:
Dim conn As New OleDb.OleDbConnection(" Provider=Microsoft.Jet.OleDb.4.0;Data Source=" & Server.MapPath("I_TRANSACT.mdb"))
Dim sql As String = "INSERT INTO Cust_info VALUES (@F_Name, @L_Name, @Nat_id, @Address, @Cell, @E_mail)"
Dim cmd As New OleDb.OleDbCommand(sql, conn)
cmd.Parameters.AddWithValue("@F_Name", txtfirst.Text)
cmd.Parameters.AddWithValue("@L_Name", txtlast.Text)
cmd.Parameters.AddWithValue("@Nat_id", txtid.Text)
cmd.Parameters.AddWithValue("@Address", txtaddress.Text)
cmd.Parameters.AddWithValue("@Cell", txtphone.Text)
cmd.Parameters.AddWithValue("@E_mail", txtemail.Text)
lblsuccess.Visible = True
lblsuccess.Text = "Successfully created!"

The following error is returned
Exception Details: System.Data.OleDb.OleDbException: Operation must use an updateable query.

Can someone help please

Sign In or Register to comment.