I made a software with a MS Access database, stored in Program Files and i can't change data in this database because it's saved in Program Files. It's working in other locations, but I need the database in Program Files.
It says: "This database has been opened read-on开发者_JS百科ly."
Does anyone know how to solve this problem?
Use Inno Setup to create an install of your Access database file to, as David points out, the users Application Data folder. The Inno Setup Third-Party Files page is a list of very useful enhancements. I've been happily using the ISTools to help with creation of the installer. As you tagged your question with ms-access-2007 you can use the free Access runtime for the executable portion.
Sample inno script which checks to see if a version of Access is installed. If not it tells you to install a runtime version of Access. If installed then it continues to install your FE MDE and other assorted files.'
Sample inno script which "wraps" the package wizard install into a single .exe
Deploying updates to your software in a Runtime environment for Access 2007
By default, the programs folder is read-only for user-level logons. You don't say your version of Windows, but for Vista/Win7, this is a problem. You either have to set the shortcut for your application to run as administrator, or change the permissions on the folder to allow write access (you can't do this unless you turn off the Orwellian SIMPLE FILE SHARING).
While it's logical to think of an Access application as a program file, the Access model breaks that logical model, because it has to be writable. The only proper place for any Access app (since Windows 2000, in fact) is the folder the %AppData% environment variable points to.
This can be done by setting the [Dirs] folder to allow read / wright access
[Dirs] {app}; Permissions: everyone-modify
With that said, I agree with David and you might consider installing in a different location.
精彩评论