You need to firstly read and understand there are SQL syntax limitations in OleDB.
"A single quote must be escaped with another single quote."
But really, forget single quotes.
Read more about using OleDB here. It's ancient technology anyway, so I would get away from OleDB and have your database ported over to SQL Server or MySQL.
However, what you may need is something like this...
try
{
connw.Open();
OleDbCommand command;
command = new OleDbCommand(
"SELECT *" +
"FROM tableA WHERE Deliveries.EmployeeID = ?, Deliveries.FIN = ?, Deliveries.TodaysOrders = ? , connw);
command.Parameters.Add(new OleDbParameter("@EMPID", Convert.ToDecimal(empsplitIt[1])));
command.Parameters.Add(new OleDbParameter("@FIN", truckSplit[1].ToString()));
command.Parameters.Add(new OleDbParameter("@TodaysOrder", "R"));
catchReturnedRows = command.ExecuteNonQuery();//Commit
connw.Close();
}
catch (OleDbException exception)
{
MessageBox.Show(exception.Message, "OleDb Exception");
}
Golden rule of database coding, is never pass a variable directly into the SQL statement like you've done above. That is opening yourself for SQL Injection big time.
'; DROP TABLE ... ;--usersplural? Do you store multiple users comma separated??u = "select uniqcode from login where users=?";and thenu.Parameters.Add("@users", OleDbType.VarChar).value = textBoxX1.Text;