Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

database insertion

i am failing to insert into an access database.am 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)
conn.Open()
cmd.ExecuteNonQuery()
cmd.Dispose()
conn.Close()
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.