Click here to Skip to main content
11,648,094 members (68,284 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Access setup
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. Smile | :)
Posted 17-Sep-12 0:09am

1 solution

Rate this: bad
good
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?[^]
  Permalink  
Comments
Gautam Raithatha at 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
0 F-ES Sitecore 395
1 jyo.net 330
2 DamithSL 300
3 OriginalGriff 277
4 CPallini 250
0 OriginalGriff 1,342
1 jyo.net 994
2 DamithSL 981
3 Sergey Alexandrovich Kryukov 893
4 CPallini 845


Advertise | Privacy | Mobile
Web01 | 2.8.150804.4 | Last Updated 17 Sep 2012
Copyright © CodeProject, 1999-2015
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