Can someone tell me why this function to delete a row in a access database is not working?
[code]
public void delete(string table, string file, string cage, string type, string animalName)
{
string deleteString;
deleteString ="delete from `" + table + "\' Where File= " + file + " and CageNo = " + cage + " and AnimalType = `" + type + "\' and Name = `" + animalName+ "\'";
Console.WriteLine("{0}", deleteString);
OdbcCommand=new OdbcCommand (deleteString);
myOdbcCommand.Connection = conn;
myOdbcCommand.ExecuteNonQuery();
}
[\code]
myOdbcCommand.Connection = conn;
myOdbcCommand.ExecuteNonQuery();
Console.WriteLine("{0}", deleteString);
}
catch(Exception e)
{
Console.WriteLine("failed to delete");
}
}
[