G
Guest
I'm trying to develop an Internet application using an Access database, and
I'm trying to insert records using an insert query. I keep receiving an
error stating that I need to use and updatable query. My insert code is as
follows:
public Int32 InsertContactMessage (String division, String name, String
email,
String phone, String subject, String message) {
m_SQL = "EXECUTE qryInsertNews '"+division+"', '"+name+"', '"+email+"',
'"+phone+"', '"+subject+"', '"+message+"'";
OleDbCommand objCommand = new OleDbCommand(m_SQL, objConnection);
Int32 intResults = 0;
try {
this.CheckConnection ();
objConnection.Open ();
intResults = objCommand.ExecuteNonQuery();
}
catch (Exception ex) {
m_Exception = ex;
}
finally {
objConnection.Close ();
objCommand.Dispose ();
objConnection.Dispose ();
}
return intResults;
}
Any ideas?
I'm trying to insert records using an insert query. I keep receiving an
error stating that I need to use and updatable query. My insert code is as
follows:
public Int32 InsertContactMessage (String division, String name, String
email,
String phone, String subject, String message) {
m_SQL = "EXECUTE qryInsertNews '"+division+"', '"+name+"', '"+email+"',
'"+phone+"', '"+subject+"', '"+message+"'";
OleDbCommand objCommand = new OleDbCommand(m_SQL, objConnection);
Int32 intResults = 0;
try {
this.CheckConnection ();
objConnection.Open ();
intResults = objCommand.ExecuteNonQuery();
}
catch (Exception ex) {
m_Exception = ex;
}
finally {
objConnection.Close ();
objCommand.Dispose ();
objConnection.Dispose ();
}
return intResults;
}
Any ideas?