Click here to Skip to main content
15,886,693 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello...

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

1 solution

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?[^]
 
Share this answer
 
Comments
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900