472,125 Members | 1,399 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,125 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 7410
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by ano1optimist | last post: by
4 posts views Thread by Derek Van Cuyk | last post: by
8 posts views Thread by Jim in Arizona | last post: by
11 posts views Thread by Arpan | last post: by
reply views Thread by leo001 | last post: by

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.