E
elan
hi all,
I really need some help here. I'm using an Access database with a web
application and I keep getting the operation must use an updateable query
error. The mdb file and directory is given full permission to everyone, the
queries causing this error are straight forward insert or update queries.
I've searched around, saw a lot of people asking, but not really any
answers. I'd really appreciate any help I can get. Some things I noticed
after this error occured: When I try to open the database in Access, it
says that the database is read-only. When I try delete the database file, it
says there's a sharing violation. It seems that only rebooting will fix the
database. Here's the code snippet that causes the error:
string dbCommandStr = "INSERT INTO `category`( name, thumbnail, parent )
VALUES( '" + catName.Value + "', '" + Path.GetFileName(
File1.PostedFile.FileName ) + "', " + Request.Form["catList"] + " )";
string dbConnectionStr = "Provider=Microsoft.JET.OLEDB.4.0; Data Source=" +
myConfig.dbPath;
OleDbConnection dbConnection = new OleDbConnection(dbConnectionStr);
OleDbCommand insertCommand = new OleDbCommand( dbCommandStr, dbConnection );
insertCommand.Connection.Open();
insertCommand.ExecuteNonQuery();
dbConnection.Close();
Server.Transfer("default.aspx");
thanks
Eric Lan
I really need some help here. I'm using an Access database with a web
application and I keep getting the operation must use an updateable query
error. The mdb file and directory is given full permission to everyone, the
queries causing this error are straight forward insert or update queries.
I've searched around, saw a lot of people asking, but not really any
answers. I'd really appreciate any help I can get. Some things I noticed
after this error occured: When I try to open the database in Access, it
says that the database is read-only. When I try delete the database file, it
says there's a sharing violation. It seems that only rebooting will fix the
database. Here's the code snippet that causes the error:
string dbCommandStr = "INSERT INTO `category`( name, thumbnail, parent )
VALUES( '" + catName.Value + "', '" + Path.GetFileName(
File1.PostedFile.FileName ) + "', " + Request.Form["catList"] + " )";
string dbConnectionStr = "Provider=Microsoft.JET.OLEDB.4.0; Data Source=" +
myConfig.dbPath;
OleDbConnection dbConnection = new OleDbConnection(dbConnectionStr);
OleDbCommand insertCommand = new OleDbCommand( dbCommandStr, dbConnection );
insertCommand.Connection.Open();
insertCommand.ExecuteNonQuery();
dbConnection.Close();
Server.Transfer("default.aspx");
thanks
Eric Lan