Click here to Skip to main content
12,892,015 members (58,136 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# Access setup

I have created a windows application in MS Visual Studio 2010 using MS Access database and created its setup. I have made the database file (.accdb) to be copied in the application directory, i.e. the project's EXE file and database file both are in same directory where the software is installed.

When I install application in default directory (i.e. C:\Program Files (x86)\Microsoft\<app_name>), I am able to access the database and login into system and also access other master data in my application. Till here everything works fine! But when I try to add or update data in database, the problem starts, and I can't modify database file. It throws an error "Operation must use an updateable query."

But when I install application on other path (say D:\Microsoft\<app_name>), I am able to run the application perfectly with adding and updating data also.

I concluded that there are some permissions related issues in Program Files directory that don't allow database file to be modified.

Please suggest some solution.

Thanks in advance. :)
Posted 17-Sep-12 0:09am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Do not try to store any data in the Program location, or any folder below that! It worked in XP and below, but since Vista, you require admin privileges in order to modify anything under Program Files.

There are loads of places you can store program data, which are much more sensible (if only becaus ethey are more likely to be included on automated backups). See here: Where should I store my data?[^]
Gautam Raithatha 17-Sep-12 6:48am
thanks a lot... :)
i'll try as per your article in my application.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170424.1 | Last Updated 17 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100