开发者

How do I distribute updates to a Access database front end?

开发者 https://www.devze.com 2022-12-19 10:26 出处:网络
I\'ve got an Access 2007 database that I developed which connects to SQL Server for the actual data storage.I used the Package Solution Wizard to create a distributable installer which included access

I've got an Access 2007 database that I developed which connects to SQL Server for the actual data storage. I used the Package Solution Wizard to create a distributable installer which included access runtime (with an ACCDE file) which I went around and installed on 15 or so PCs. Anyway, my question is, what is the best way to distribute updates to this database? Right now I'd need to go around and remove and reinstall. That's not a problem... I was just wondering if there was another way.

I've tried leaving the front end on a network share but it seems that most people suggest storing the front-end on the local machine, which makes sense. The problems I've run into when I leave it on a network share (at least with Access 2003 mdbs) is that I find myself needing to compact and repair often and I also have to kill the open sessions (user's who have the file open) when upgrading. I would imagine it开发者_StackOverflow could also hypothetically create an unnecessary bottleneck if the user was not on the local network.


Automating front-end distribution is trivial. It's a problem that has been solved repeatedly. Tony Toews's http://autofeupdater.com is one such solution that is extremely easy to implement and completely transparent to the end user.


We developed a vbscript 'launcher' for our access apps. That is what is linked to on the start menu of user's pcs and it does the following.

  • It checks a version.txt file located on a network share to see whether it contains different text to a locally stored copy
  • If the text is different it copies the access mdb and the new version.txt to the user's hard drive.
  • Finally it runs the mdb in access

In order to distribute an update to the user's pc all that is required is to change the text in version.txt on the network share.

Perhaps you can implement something similar to this


  • Make a batch file on the server (network drive).
  • Create a shortcut link to that batch file.
  • Copy the shortcut to User's Desktop.
  • When user double-clicks on shortcut, it will copy a fresh copy from network to local.
  • Replace old database.adp on the server drive when you update a new version.
  • Each user gets a copy of database.adp on their machine.
  • Remove Security warning when opening file from network share is here.

Batch File

@ECHO OFF

REM copy from network drive to local
xcopy "Your_Network_Drive\database.adp" "C:\User\database.adp" /Y /R /F 

REM call your database file - Access 2007
"C:\Program Files\Microsoft Office\Office12\MSAccess.EXE" "C:\User\database.adp"  


This is a very old post and I used the autofeupdater until it stopped working so I wrote one of my own and it has evolved over the last few years into something that I have used with many clients. It's so simple to use and there is no interface. Just an EXE and a very simple config file.

Please check it out here. I can also help with custom solutions if none of the configurations work for your needs. http://www.dafran.ca/MS-Access-Front-End-Loader.aspx


After trying all of the solutions above (not exactly these solutions but these are the common suggestions in the Access community), I developed a system entirely within Access using VBA that allows an admin DB to create and publish objects to client DBs without the need for user intervention or management of multiple DB files.

This approach has several benefits: 1. It simplifies the development process by having a dedicated environment (admin DB) for development and testing totally separate from the client DBs. 2. It simplifies the update/distribution process by allowing a developer to push out updates in real time that client DBs can implement in the background, without involving users. Can also allow devs to roll back to previous versions if desired. 3. It could be used as a kind of change management system within Access for developers who want to commit multiple changes to objects and modules and retain past changes. 4. It allows for easier user access control by allowing an admin to easily assign certain objects to specific users/roles without needing to maintain multiple versions of the DB.

I will hopefully post the code to GitHub soon, I just have to get clearance from my workplace to release it. I will edit this post to include the link when I have.


We have usually kept the Access front ends on network drives, and just put up with the need to compact and repair on a regular basis. You will probably find you need to do that even when they are installed locally, anyway.

If you must have it installed locally, there are various tools which will enable you to "push out" software updates, and the guys over on ServerFault would have more information on those. Assuming such tools aren't available, the only other option I can think of is to write a small loader program that checks the local .MDB against a master copy on the server, and re-copies it across if they are different, before then launching the MDB.

0

精彩评论

暂无评论...
验证码 换一张
取 消