System.Data.OleDb.OleDbException when writing script for button to update tables

Viewed 22

Trying to create an update tables button to update an accessDB table and getting this error: System.Data.OleDb.OleDbException I'm guessing its something to do with my SQL update statements but i'm not sure what.

 Private Sub buttonupdate_Click(sender As Object, e As EventArgs) Handles buttonupdate.Click
        conn.Open()
        cmd = conn.CreateCommand()
        cmd.CommandType = CommandType.Text
        cmd.CommandText = "update BookAccess set Author = '" + txtauthor.Text + "' where Title = '" + txttitle.Text + "' where Genre = '" + txtgenre.Text +
            "' where ISBN = '" + txtisbn.Text + "' where Quantity = '" + txtquantity.Text + "' where Price = '" + txtprice.Text + "'" 'SQL code to update table entry
        cmd.ExecuteNonQuery()
        conn.Close()
        MessageBox.Show("Entry updated") 'messagebox letting user know data updated
0 Answers
Related