Click here to Skip to main content
15,911,360 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a setup project for my application in c#.
The problem is that an error named: "System.Data.OleDb.OleDbException: Operation must use an updateable query." occurs while my application tries to insert a row in the access 2007 database.
the database is installed in the same folder where the .exe file is installed.

I have checked for the permissions to the database but found no place to change the permission programatically for the database.

Thank you in advance!
Posted

1 solution

Simple: don't install data files in program folders.
Access to Program Files (and subfolders) is restricted to reduce the harm done by virus and similar applications.
Instead, store the Db in a sensible location: Where should I store my data?[^] should help you find somewhere more appropriate.
 
Share this answer
 
Comments
Member 11040029 7-Sep-14 7:26am    
Hey thnx! But please guide me on how to install the data file at other location since i am using a setup project in the c# for the first time. Guide me how to set a different installation path for the data file.
OriginalGriff 7-Sep-14 7:33am    
How would I know? :laugh:
I have no idea at all which installer you are using, or how it works...
Member 11040029 7-Sep-14 7:42am    
Its a Setup Project of visual studio
OriginalGriff 7-Sep-14 8:38am    
So...right click the "File system on Target Machine" in the setup file list
Click "Add Special Folder"
Add "User's Application Data Folder"

Right click "User's Application Data Folder" in the setup file list, and the select "Add...File..." and add your database to there.

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