MS Access, how to update query ???

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I want to perform a simple update query on a MS Access database.
The update query itself is a stored procedure requiring a single parameter
and is called via an ASP.NET page.

The error message I'm getting is: "Operation must use an updateable query"


* The MS Access update query:
________________________

PARAMETERS ValueRight Long;
UPDATE category SET leftvalue = leftvalue+2
WHERE leftvalue>[ValueRight]-1;


* The ADO.NET code:
__________________

OleDbConnection oleDbConnection = new
OleDbConnection(this.ConnectionString);

oleDbConnection.Open();



OleDbCommand oleDbCommand = new OleDbCommand();

oleDbCommand.Connection = oleDbConnection;

oleDbCommand.CommandType = System.Data.CommandType.StoredProcedure;

oleDbCommand.CommandText = "[qryupdatecategoryLeft]";

oleDbCommand.Parameters.Add("@ValueRight", this.LabelValueRight.Text);

oleDbCommand.ExecuteNonQuery();



oleDbConnection.Close();





Any ideas ???



Thanks,

Steve.
 
Hi,

you need to give permissions on your MDB file for ASP.NET process

Rajeev
 
You may not have permissions (either IUSR or SYSTEM) to the directory where
the Access MDB file was stored. Try to add everyone-full control to the
directory to see if it works.



Sincerely,

Kevin
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! - www.microsoft.com/security

--------------------
| From: <->
| Subject: MS Access, how to update query ???
| Date: Thu, 31 Jul 2003 06:06:10 +0100
| Lines: 64
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| NNTP-Posting-Host: ACBC2C76.ipt.aol.com 172.188.44.118
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:57104
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| Hi,
|
| I want to perform a simple update query on a MS Access database.
| The update query itself is a stored procedure requiring a single parameter
| and is called via an ASP.NET page.
|
| The error message I'm getting is: "Operation must use an updateable query"
|
|
| * The MS Access update query:
| ________________________
|
| PARAMETERS ValueRight Long;
| UPDATE category SET leftvalue = leftvalue+2
| WHERE leftvalue>[ValueRight]-1;
|
|
| * The ADO.NET code:
| __________________
|
| OleDbConnection oleDbConnection = new
| OleDbConnection(this.ConnectionString);
|
| oleDbConnection.Open();
|
|
|
| OleDbCommand oleDbCommand = new OleDbCommand();
|
| oleDbCommand.Connection = oleDbConnection;
|
| oleDbCommand.CommandType = System.Data.CommandType.StoredProcedure;
|
| oleDbCommand.CommandText = "[qryupdatecategoryLeft]";
|
| oleDbCommand.Parameters.Add("@ValueRight", this.LabelValueRight.Text);
|
| oleDbCommand.ExecuteNonQuery();
|
|
|
| oleDbConnection.Close();
|
|
|
|
|
| Any ideas ???
|
|
|
| Thanks,
|
| Steve.
|
|
|
|
|
|
|
|
|
|
|
 

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

Back
Top