473,416 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

"Operation must use an updateable query" on ExecuteNonQuery()

MDW
Hey all.

I'm confused. I'm trying to add a single record into an Access 2000 database
using ASP.Net. Here is the code:

objConn = New OleDbConnection(strConnect)
objConn.Open

objCommand = New OleDbCommand("INSERT INTO LOGIN_MASTER (LOGIN_ID, PWD,
F_NAME, L_NAME, TYPE_ID) VALUES ('" & strEmail & "','" & strPwd & "','" &
strFName & "','" & strLName & "','" & strType & "')",objConn)

objCommand.ExecuteNonQuery()
objConn.Close

However, when I try to run it, I get the following error:

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.OleDb.OleDbException: Operation must use an
updateable query.

It highlights the line "objCommand.ExecuteNonQuery()" as the source of the
error. That error seems entirely out of sorts for what I thought
ExecuteNonQuery() is intended for - running SQL statements against your db
that don't return recordsets. Anyone see what could be causing the problem?
--
Hmm...they have the Internet on COMPUTERS now!
Nov 19 '05 #1
4 6481
MDW wrote:
Hey all.

I'm confused. I'm trying to add a single record into an Access 2000
database using ASP.Net. Here is the code:

objConn = New OleDbConnection(strConnect)
objConn.Open

objCommand = New OleDbCommand("INSERT INTO LOGIN_MASTER (LOGIN_ID,
PWD, F_NAME, L_NAME, TYPE_ID) VALUES ('" & strEmail & "','" & strPwd
& "','" & strFName & "','" & strLName & "','" & strType &
"')",objConn)

objCommand.ExecuteNonQuery()
objConn.Close

However, when I try to run it, I get the following error:

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.OleDb.OleDbException: Operation must
use an updateable query.

It highlights the line "objCommand.ExecuteNonQuery()" as the source
of the error. That error seems entirely out of sorts for what I
thought ExecuteNonQuery() is intended for - running SQL statements
against your db that don't return recordsets. Anyone see what could
be causing the problem?


Admittedly, the error message is misleading.

The reason for this error message is that the process runs
under an identity (usually ASPNET) that only has read access
to the database.

Right click on the database file in Windows Explorer, go to the
Security tab, and give the ASPNET user modify rights to the file.

--

Edge
Nov 19 '05 #2
MDW
Ah! Yes, that was EXACTLY it! Thanks.

I know I'm new to ASP.Net, but I was starting to wonder whether I really
knew what an updateable query was. ;)

"Edge" wrote:
MDW wrote:
Hey all.

I'm confused. I'm trying to add a single record into an Access 2000
database using ASP.Net. Here is the code:

objConn = New OleDbConnection(strConnect)
objConn.Open

objCommand = New OleDbCommand("INSERT INTO LOGIN_MASTER (LOGIN_ID,
PWD, F_NAME, L_NAME, TYPE_ID) VALUES ('" & strEmail & "','" & strPwd
& "','" & strFName & "','" & strLName & "','" & strType &
"')",objConn)

objCommand.ExecuteNonQuery()
objConn.Close

However, when I try to run it, I get the following error:

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.OleDb.OleDbException: Operation must
use an updateable query.

It highlights the line "objCommand.ExecuteNonQuery()" as the source
of the error. That error seems entirely out of sorts for what I
thought ExecuteNonQuery() is intended for - running SQL statements
against your db that don't return recordsets. Anyone see what could
be causing the problem?


Admittedly, the error message is misleading.

The reason for this error message is that the process runs
under an identity (usually ASPNET) that only has read access
to the database.

Right click on the database file in Windows Explorer, go to the
Security tab, and give the ASPNET user modify rights to the file.

--

Edge

Nov 19 '05 #3
ERROR [HY000] Operation must use an updateable query
http://www.howtodothings.com/showart...sp?article=749
--
Pete
====
Read or write articles on just about anything
http://www.HowToDoThings.com

My blog
http://blogs.slcdug.org/petermorris/
Nov 19 '05 #4
> Right click on the database file in Windows Explorer, go to the
Security tab, and give the ASPNET user modify rights to the file.
Remember, that Access needs to create the *.ldb (lock) file in the same
directory as the database. Giving rights to just the *.mdb may not be
enough. I like to keep my *.mdb & *.ldb in a subfolder and permission that
instead.

Greg

"Edge" <ed**@edge.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... MDW wrote:
Hey all.

I'm confused. I'm trying to add a single record into an Access 2000
database using ASP.Net. Here is the code:

objConn = New OleDbConnection(strConnect)
objConn.Open

objCommand = New OleDbCommand("INSERT INTO LOGIN_MASTER (LOGIN_ID,
PWD, F_NAME, L_NAME, TYPE_ID) VALUES ('" & strEmail & "','" & strPwd
& "','" & strFName & "','" & strLName & "','" & strType &
"')",objConn)

objCommand.ExecuteNonQuery()
objConn.Close

However, when I try to run it, I get the following error:

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.OleDb.OleDbException: Operation must
use an updateable query.

It highlights the line "objCommand.ExecuteNonQuery()" as the source
of the error. That error seems entirely out of sorts for what I
thought ExecuteNonQuery() is intended for - running SQL statements
against your db that don't return recordsets. Anyone see what could
be causing the problem?


Admittedly, the error message is misleading.

The reason for this error message is that the process runs
under an identity (usually ASPNET) that only has read access
to the database.

Right click on the database file in Windows Explorer, go to the
Security tab, and give the ASPNET user modify rights to the file.

--

Edge

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Tom wilson | last post by:
This is driving me nuts. I'm trying to update an Excel spreadsheet using ADO.Net and Oledb in VB.Net. The connection is open, the adapter is connected and the dataset is loaded. Here's the code...
1
by: mp | last post by:
Hi, I have following problem: Operation must use an updateable query I have use OleDb, C# and ASP.NET and MS Access DB named pubs. Code:
0
by: abdul haleem | last post by:
hiye guys, can anyone tell me whats wrong with this piece of code? to my knowledge, its looks and seems fine. i'm very puzzle by this error. i get this error msg "Operation must use an updateable...
4
by: John | last post by:
Hi I am getting error on ExecuteNonQuery() . Full code is given below. The values I have given are; ('trtrt', 'retret', '1/1/2', '333'). Any idea what is the problem? Thanks Regards
606
by: Neil Zanella | last post by:
Hello, I am trying to update an MS access database from ASP.NET. I am using IIS on Windows XP Pro. I can issue SELECT statements from ASP.NET using ADO.NET but I cannot seem to be able to carry...
2
by: SheryMich | last post by:
Hi - I am having a bit of a problem with the insert into a database. When I go to insert a record into an un-keyed, single table Access database, I get the aforementioned ''Operation Must Use an...
1
by: Muskito | last post by:
HELP!!! Hello All, I'm using VB.net 2003 and trying to update data in Excel worksheet. The program selects data from the excel, updates something in the MSSQL DB and then tries to update...
11
by: Arpan | last post by:
I have always been working with SQL Server 2005 for ASP.NET apps but due to some reasons, had to revert back to MS-Access 2000. When I try to insert/update a MS-Access DB table (MDB), ASP.NET...
1
by: pavya | last post by:
Hi, I have developed one Web application. At that time my system had a FAT file system on it and this application worked properly. But now i have converted FAT file system to NTFS file system and...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.