private void button1_Click(object sender, EventArgs e)
{
// Saves changes made in the details
OdbcConnection myConnection = new OdbcConnection();
OdbcCommand cmd = myConnection.CreateCommand();
string myConnectionString = @"Driver={Microsoft Access Driver (*.mdb)};" + "Dbq=C:/DROPS-Data/Derrick.mdb";
myConnection.ConnectionString = myConnectionString;
myConnection.Open();
cmd.CommandText = "UPDATE InspInfo SET CompanyName =" + textBox1.Text + "," + "CustomerRef =" + textBox2.Text + ", Contact =" +textBox3.Text + ", RigName =" + textBox4.Text + ", Location =" + textBox5.Text + " WHERE WONo =" + textBox6.Text ;
cmd.ExecuteNonQuery();
myConnection.Close();
}
This is a windows project ,,,trying to update the connected database from the changes in the text boxes in the form....
Getting an error
System.Data.Odbc.OdbcException (0x80131937): ERROR [42000] [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression
Can anyone please help

Pramod ThakurRank #400 · 6.3K reputationPosted Oct 11, 2017, 2:41 AM EDT
Ramesh PalanivelRank #372 · 6.8K reputationPosted Oct 10, 2017, 11:55 PM EDT
Rajkiran SwainRank #165 · 14.4K reputationPosted Oct 11, 2017, 1:06 AM EDT
Rao Varrey35 reputationPosted Oct 11, 2017, 7:12 PM EDT