Hteo bih da iz web frome update-jem podatke u access bazi koristeći odbc konekciju.Ali ne ide :(
Kod:
private void Button1_Click(object sender, System.EventArgs e)
{
OdbcConnection conn = null;
conn = new OdbcConnection(
"Driver={Microsoft Access Driver (*.mdb)};" +
"DBQ="+ Server.MapPath("db1.mdb"));
conn.Open();
OdbcCommand cmd = new OdbcCommand("UPDATE TestTabela SET Kolona =(Kolona*2)",conn);
cmd.ExecuteNonQuery();
conn.Close();
}
Postavio sam na formi samo jedno dugme testa radi.
Umesto da update-je bazu izleti exception:
Server Error in '/WebApplication3' Application.
--------------------------------------------------------------------------------
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.Odbc.OdbcException: ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
Source Error:
Line 56: conn.Open();
Line 57: OdbcCommand cmd = new OdbcCommand("UPDATE TestTabela SET Kolona = (Kolona*2)",conn);
Line 58: cmd.ExecuteNonQuery(); //// Ovde je problem
Line 59: conn.Close();
Line 60: }
Znali neko u čemu je problem?