473,405 Members | 2,354 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,405 software developers and data experts.

Question: Operation Must Use an Updateable Query

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 Updateable Query' error.

Points:
- The database is in my local temp directory, not inetpub
- The directory has read/write permissions
- The database has read/write permissions
- I created another version of the dbase and tried to reference it with the
same result
- I can access the dbase and sucessfully select rows from the database to
populate a datagrid

Other points:
- Database sucessfully opens and closes
- IIS was installed after the VB.net code. I re-ran gacutil to re-register
dlls

Code Snippet:
Dim mSQL As String = "INSERT INTO Messages(LastName, FirstName,
EmailAddress, MessageDate, Message) VALUES ('Smith','John',
's********@mail.com','10/26/2003','stuffs')"
Dim objCmd As New OleDbCommand(mSQL, cn)

Try
objCmd.ExecuteNonQuery()

Catch ex As Exception
Label.Text = ex.Message

End Try

I am not sure at this point whether this is a VB or ADO issue. Any thoughts
or suggestions would be greatly appreciated.
- Sheryl
Nov 20 '05 #1
2 7492
Check out this link.. there's a Knowledgebase article about
this...http://www.dotnet247.com/247referenc.../14/74813.aspx

However, can you fire any updates, insert or deletes? Basically, will this
query definitely run if you do it from within access? If you were using a
CommandBuilder or DA Configuratino wizard, the problem would probably be the
lack of a key, but that doesn't appear to be the problem. If you are sure
the query will run, then the link above is the most likely solution.

HTH,

Bill
"SheryMich" <sm******@yahoo.com> wrote in message
news:Kr*****************@newsread1.news.atl.earthl ink.net...
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 Updateable Query' error.

Points:
- The database is in my local temp directory, not inetpub
- The directory has read/write permissions
- The database has read/write permissions
- I created another version of the dbase and tried to reference it with the same result
- I can access the dbase and sucessfully select rows from the database to
populate a datagrid

Other points:
- Database sucessfully opens and closes
- IIS was installed after the VB.net code. I re-ran gacutil to re-register
dlls

Code Snippet:
Dim mSQL As String = "INSERT INTO Messages(LastName, FirstName,
EmailAddress, MessageDate, Message) VALUES ('Smith','John',
's********@mail.com','10/26/2003','stuffs')"
Dim objCmd As New OleDbCommand(mSQL, cn)

Try
objCmd.ExecuteNonQuery()

Catch ex As Exception
Label.Text = ex.Message

End Try

I am not sure at this point whether this is a VB or ADO issue. Any thoughts or suggestions would be greatly appreciated.
- Sheryl

Nov 20 '05 #2
Bob
Hiya,

You say the database and the directory it is in have read/write access...
but for who? If you are running the ASP under the default IIS account you
will need to explicitly set permissions for that account on the file and
folder. By default the IIS account (IUSR_ComputerName) has permissions to
bugger all.

Even if you are running the ASP under a user account you will still need to
ensure it has permissions but the IUSR account is very limited so least
likely to work by default.

Also, you don't show how you open the database so we have to assume you
didn't open it read only...

Try these search results for more info:

http://search.microsoft.com/search/r...qa=&qn=&c=&s=0

Cheers

"SheryMich" <sm******@yahoo.com> wrote in message
news:Kr*****************@newsread1.news.atl.earthl ink.net...
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 Updateable Query' error.

Points:
- The database is in my local temp directory, not inetpub
- The directory has read/write permissions
- The database has read/write permissions
- I created another version of the dbase and tried to reference it with the same result
- I can access the dbase and sucessfully select rows from the database to
populate a datagrid

Other points:
- Database sucessfully opens and closes
- IIS was installed after the VB.net code. I re-ran gacutil to re-register
dlls

Code Snippet:
Dim mSQL As String = "INSERT INTO Messages(LastName, FirstName,
EmailAddress, MessageDate, Message) VALUES ('Smith','John',
's********@mail.com','10/26/2003','stuffs')"
Dim objCmd As New OleDbCommand(mSQL, cn)

Try
objCmd.ExecuteNonQuery()

Catch ex As Exception
Label.Text = ex.Message

End Try

I am not sure at this point whether this is a VB or ADO issue. Any thoughts or suggestions would be greatly appreciated.
- Sheryl

Nov 20 '05 #3

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...
6
by: ano1optimist | last post by:
I have been running these queries in Access 2000 with no problems. This week, I had to install Access 2003 to create some runtime versions for another application, and now I keep getting "operation...
4
by: MDW | last post by:
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 =...
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...
4
by: Derek Van Cuyk | last post by:
Hi everyone! I'm trying to write a web application in school that utilizes a MS Access database. I can read and everything fine from it but when I try to add a new record I get an exception that...
8
by: Jim in Arizona | last post by:
I've been using an example out of a book to be able to edit the rows in a database. I am getting the following error: ========================================================...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.