Operation must use an updateable query.

G

Guest

Hi
I have used the following code to update Access 97 code with no problem but
when moved it into ASP.Net as WebMethod i get "Operation must use an
updateable query"
I think it has to do with write permission but not sure how to fix it. Any
suggestion will be appreciated.
AL
code===============
loCommand = New OleDbCommand
loCommand.Connection = MyConnection

loCommand.CommandText = "UPDATE [Claim Form Table] SET ClaimCity =
'Seattle' WHERE ClaimtID = 40"

loCommand.Connection.Open()
loCommand.ExecuteNonQuery()
loCommand.Connection.Close()
 
G

Guest

In the Properties window of the .mdb, look in the Security tab. Try giving
the IUSR_MACHINE account or the guest account write permission. Add the
account to the list if necessary.
 
G

Guest

Hi Charlie,
the source is in Access 97 and I cannot convert it to 2000. Is there any way
i can do this programmatically?
Thanks
Al

Charlie said:
In the Properties window of the .mdb, look in the Security tab. Try giving
the IUSR_MACHINE account or the guest account write permission. Add the
account to the list if necessary.

Al said:
Hi
I have used the following code to update Access 97 code with no problem but
when moved it into ASP.Net as WebMethod i get "Operation must use an
updateable query"
I think it has to do with write permission but not sure how to fix it. Any
suggestion will be appreciated.
AL
code===============
loCommand = New OleDbCommand
loCommand.Connection = MyConnection

loCommand.CommandText = "UPDATE [Claim Form Table] SET ClaimCity =
'Seattle' WHERE ClaimtID = 40"

loCommand.Connection.Open()
loCommand.ExecuteNonQuery()
loCommand.Connection.Close()
 
G

Guest

You should be able to find a very simple solution to this. If the database
can be updated in the windows environment, but not a web environment, it
should be a simple matter of setting a web permission. Can you get a SELECT
statement to work? What about an INSERT?

If you right click on the .mdb file (make sure it is closed), you should see
a Security tab. The Security tab should be there for any file. Did you do
that? You may also have to set permissions on folders.

I don't know of a way to do it programatically.

Al said:
Hi Charlie,
the source is in Access 97 and I cannot convert it to 2000. Is there any way
i can do this programmatically?
Thanks
Al

Charlie said:
In the Properties window of the .mdb, look in the Security tab. Try giving
the IUSR_MACHINE account or the guest account write permission. Add the
account to the list if necessary.

Al said:
Hi
I have used the following code to update Access 97 code with no problem but
when moved it into ASP.Net as WebMethod i get "Operation must use an
updateable query"
I think it has to do with write permission but not sure how to fix it. Any
suggestion will be appreciated.
AL
code===============
loCommand = New OleDbCommand
loCommand.Connection = MyConnection

loCommand.CommandText = "UPDATE [Claim Form Table] SET ClaimCity =
'Seattle' WHERE ClaimtID = 40"

loCommand.Connection.Open()
loCommand.ExecuteNonQuery()
loCommand.Connection.Close()
 
G

Guest

Charlie,
I can use Select with no problem but Insert and Update will fail in web
services but not in windows.
i have right click on the .mdb and it is not set to RedOnly. There is no
Security in richt click menu.

Charlie said:
You should be able to find a very simple solution to this. If the database
can be updated in the windows environment, but not a web environment, it
should be a simple matter of setting a web permission. Can you get a SELECT
statement to work? What about an INSERT?

If you right click on the .mdb file (make sure it is closed), you should see
a Security tab. The Security tab should be there for any file. Did you do
that? You may also have to set permissions on folders.

I don't know of a way to do it programatically.

Al said:
Hi Charlie,
the source is in Access 97 and I cannot convert it to 2000. Is there any way
i can do this programmatically?
Thanks
Al

Charlie said:
In the Properties window of the .mdb, look in the Security tab. Try giving
the IUSR_MACHINE account or the guest account write permission. Add the
account to the list if necessary.

:

Hi
I have used the following code to update Access 97 code with no problem but
when moved it into ASP.Net as WebMethod i get "Operation must use an
updateable query"
I think it has to do with write permission but not sure how to fix it. Any
suggestion will be appreciated.
AL
code===============
loCommand = New OleDbCommand
loCommand.Connection = MyConnection

loCommand.CommandText = "UPDATE [Claim Form Table] SET ClaimCity =
'Seattle' WHERE ClaimtID = 40"

loCommand.Connection.Open()
loCommand.ExecuteNonQuery()
loCommand.Connection.Close()
 
G

Guest

Thanks Charlie, It is working can believe it was so simple i make the folder
shared and gave users premising to modify and it fix the problem.

Charlie said:
You should be able to find a very simple solution to this. If the database
can be updated in the windows environment, but not a web environment, it
should be a simple matter of setting a web permission. Can you get a SELECT
statement to work? What about an INSERT?

If you right click on the .mdb file (make sure it is closed), you should see
a Security tab. The Security tab should be there for any file. Did you do
that? You may also have to set permissions on folders.

I don't know of a way to do it programatically.

Al said:
Hi Charlie,
the source is in Access 97 and I cannot convert it to 2000. Is there any way
i can do this programmatically?
Thanks
Al

Charlie said:
In the Properties window of the .mdb, look in the Security tab. Try giving
the IUSR_MACHINE account or the guest account write permission. Add the
account to the list if necessary.

:

Hi
I have used the following code to update Access 97 code with no problem but
when moved it into ASP.Net as WebMethod i get "Operation must use an
updateable query"
I think it has to do with write permission but not sure how to fix it. Any
suggestion will be appreciated.
AL
code===============
loCommand = New OleDbCommand
loCommand.Connection = MyConnection

loCommand.CommandText = "UPDATE [Claim Form Table] SET ClaimCity =
'Seattle' WHERE ClaimtID = 40"

loCommand.Connection.Open()
loCommand.ExecuteNonQuery()
loCommand.Connection.Close()
 
P

Paul Clement

¤ Hi
¤ I have used the following code to update Access 97 code with no problem but
¤ when moved it into ASP.Net as WebMethod i get "Operation must use an
¤ updateable query"
¤ I think it has to do with write permission but not sure how to fix it. Any
¤ suggestion will be appreciated.
¤ AL
¤ code===============
¤ loCommand = New OleDbCommand
¤ loCommand.Connection = MyConnection
¤
¤ loCommand.CommandText = "UPDATE [Claim Form Table] SET ClaimCity =
¤ 'Seattle' WHERE ClaimtID = 40"
¤
¤ loCommand.Connection.Open()
¤ loCommand.ExecuteNonQuery()
¤ loCommand.Connection.Close()
¤

If you're not using impersonation for your web application then you need to provided sufficient
permissions (Read, Update, Delete, Create) for the local ASPNET account to the folder where the
Access database is located.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 

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

Top