Click here to Skip to main content
15,917,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created an application with ms access database and also created setup of it. I am able to read the database but when i try to update the database it gives me an error. It prevents me to update the database. How to enable the database to allow update and changes? any one can please guide me? Thanks in advance...
Posted

1 solution

If you install your application to the Program Files directory (along with the database) then it will be read-only. You should install the database to the Program Data directory instead of Program Files.
 
Share this answer
 
Comments
Naikniket 5-Jun-13 21:50pm    
i have tried to find program data/users program data directory in to (file system on target machine>add special folder) but i cant find any option for program data or users program data. How to achieve this? And also i am using Application.StartupPath ("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\database name.accdb") to connect with databse. What changes will needed after doing this?
Ron Beyer 5-Jun-13 22:25pm    
I'm not sure how you are creating the setup program, so I can't help with that, but see here on using the Environment.SpecialFolders to get the ApplicationData directories:

http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx

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