Sandip's Programming Zen

An attempt to share tech/coding experiences

Solution: Error, Operation must use an updatable query

with 9 comments

This is a common error I have seen developers encounter many times when they are using MS Access database in their .Net application. It occurs when you try to Add, update or delete any record.

Reason: Your database is in a folder where there is no write/change permission.

Resolution:

If using Windows 2000 – IIS5
– the {Server}\ASPNET User Account must have Read, Write, and Change Control of the Folder where database resides

If using Windows 2003 – IIS6
– the NETWORK SERVICE User Account must have Read, Write, and Change Control of the Folder where database resides

Giving EVERYONE account full control will solve your problem too but Never do that as it will expose your system to external attacks within network.

Advertisements

Written by Sandip

February 13, 2008 at 4:27 pm

Posted in Troubleshooting

9 Responses

Subscribe to comments with RSS.

  1. Thanks, that solved my problem

    sandy

    February 28, 2008 at 6:05 pm

  2. please help me,please help me , my web site dosent work , thank you thank you.i dont know to do,my error is : operation must use an updatable query

    Amir

    April 12, 2008 at 10:29 am

  3. I am getting same error in windows application.
    This application was running perfectly from last few days. But I started getting this error from today morning only.

    Right now my acces database contains some 300000 records.
    Is it due to such a huge number of records?

    Harshal

    June 27, 2008 at 6:33 am

  4. 1) Have you given the users rights to the mdf file or the folder? Access requires a second log file to be dynamically created and destroyed when you open it. If you don’t have create and remove rights on the folder, it might not work properly.

    2) Make sure your table data is coming from a single table with no aggregation or calculated columns. If you try to update data in joined tables, you will see this behavior.

    3) Make sure you have unique indexes on your rows. I think this is more a problem on SQL Server than access, but it doesn’t hurt to have anyway.

    4) Make sure you are not opening the database with exclusive locks. That would cause a second user to fail.

    Hope, one of above will work.

    Sandip

    June 27, 2008 at 6:47 am

  5. I haven’t changed any permissions or rights of that folder.
    That windows application was running well from last 5 days.
    But today it started giving this error when trying to insert new record in one table.
    Then I copied that insert query from from .net’s debugger and executed it directly into the Access Database and it inserted record successfully.
    Then why it is executing same query from application.
    The database table in which I am trying to insert record contains 3,00,000 records.

    Harshal

    June 27, 2008 at 7:01 am

  6. SORRY, In above post last two lines should be –
    Then why it is NOT executing same query from application.
    The database table in which I am trying to insert record contains 3,00,000 records.

    Harshal

    June 27, 2008 at 7:07 am

  7. Ok, this clearly says that you don’t have any syntax issues, but precisely a permission issue. Number of records has nothing to do with it.
    Make sure again you have “Write” permission on the mdb.

    Sandip

    June 28, 2008 at 4:59 am

  8. Tnx for this forum, i already solve my problem about this issue of executing an updatable query error. I just right click the folder where my database access resides and add the in the security tab the user {SERVER}\ASPNET and it works. tnx a lot!!

    isep

    July 14, 2008 at 1:49 am

  9. thanks a lot to all you guy’s ..I m tired of that error so much that i stopped my web project for some time.Thanks again for solution and keep posting such useful things…

    atul nar

    November 8, 2008 at 6:43 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: