Operation must use updateable query

amolgoel

Member
Joined
May 22, 2003
Messages
5
Hi,

Yes, I am getting the dreaded Operation must use an updateable query in ADO.NET code Im using to update an Access Database.
From previous posts I know the error lies not in the code but with my permissions for the ASPNET user for the directory containing the Access file.
I tried Windows Explorer to IIS Console to try and grant Write priviledge to the ASPNET user, but couldnt find a way to do it.
If I try to share the folder containing the File by using Web Sharing tab it says The alias "LM/W3SVC/1/Root/FolderName" already exists. Please choose a different alias. Even using a different name and then accessing the file through that name isnt helping.
I spent atleast 5-6 hrs. on this today. Id really appreciate if anyone could lead me to right direction in correcting this. If you think additional info is required to attack this, please do tell me, Ill post that.

Thanks.
Amol
 
Just to be on the save side, can you give us the SQL statement that youre using? Also, are you updating a View on the table? The reason I ask about the View, is that if you are updating through a View which is made up of multiple tables, then youll get an error if your update command effects more then one table from the view.

Anyway back to the user access problem here.. Im not to familiar with Access, but how it works with MSDE is that you need to set the user as a DBO (database owner) for them to be able to update the database.
 
Thanks for your interest Wyrd. It was indeed a permissions problem. There was a weird(I guess this is the correct spelling :-) ) way of granting ASPNET user Write access on DB, which someone suggested me how to do, and its working now.

Though I am not using Views, for further information purposes only, do you know a way how to update Views.

Thanks once again.
Amol
 
Ah good to see its working.

For Views, you should probably check the online documentation for full details. Off the top of my head though, for a View to even be updatable through INSERT and UPDATE (Im going off of what Ive read so take it with a grain of salt), the query in which was used to create the View cant contain things such as TOP, UNION GROUP BY and DISTINCT. When a View is updatable and joins multiple tables, your update can only effect one of those tables. DELETE however can only be used on single table Views.

Once again Im talking about actual database Views here, not the DataView object in .NET.
 
Thanks for the information, Wyrd. Oh and I had figured out which Views are you talking about earlier :-)

- Amol
 
Back
Top