Small problem ... but i don't see the answer :(

N

Nick Van Dyck

Hello!

This is the code, the error is described below.

string tmp_value_1 = txtName.Text;
string tmp_value_2 = txtMessage.Text;

OleDbConnection dbConn = new
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data
source=..../T4.mdb");
OleDbCommand dbComm = new OleDbCommand();
dbComm.CommandText = "QRY_SHOUTBOX_INSERT";
dbComm.CommandType = CommandType.StoredProcedure;
dbComm.Connection = dbConn;

OleDbParameter dbParam = new OleDbParameter("@NAME", DbType.String);
dbParam.Value = tmp_value_1;
dbComm.Parameters.Add(dbParam);

dbParam = new OleDbParameter("@MESSAGE", DbType.String);
dbParam.Value = tmp_value_2;
dbComm.Parameters.Add(dbParam);

dbParam = new OleDbParameter("@IP", DbType.String);
dbParam.Value = HttpContext.Current.Request.UserHostAddress.ToString();
dbComm.Parameters.Add(dbParam);

dbConn.Open();
//dbComm.ExecuteReader();
dbComm.ExecuteNonQuery();
dbConn.Close();


VS.NET gives me this error:
Operation must use an updateable query

The query QRY_SHOUTBOX_INSERT is working fine in MS Access, but won't work
with this code. Anybody got an idea? I tried altering the security of the
database (adding the iusr_machine an giving it full control, including the
directory where the database is located).


Greetz!
Nick
 
J

John Timney \(ASP.NET MVP\)

If I recall my errors correctly, this one is usually a write permissions
problem on the directory that the access db resides within.
--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top