问题
We have a MS Application which is used by around 10 users at the same time. The performance is poor and they complain. Plus I have hard time to deploy a new version because some users let the Access opened during the night and the file is locked. Is there a way how to speed it up and deploy a new version?
回答1:
We have 35 users using a front end Access with only forms and code connected to SQL database. There are 971 tables and views on that SQL server - you can use a different Access database and link the tables instead of SQL server. The Access file with code is stored on a shared drive and users do not lunch it direct but via a .bat file which copies the Access to the local machine and runs it. When I need to deploy a new version I just overwrite the Access file on the share drive (it is never locked because it is not used directly) and next time users start working they get a fresh version. I even have a functionality which displays to the users a note that there is a new version of the program and asks them to restart.
Here is a sample script for your .bat file (it copies also a file to change Access menu bar):
echo off
echo Company Application v2016 [Staff] PROD
echo Deleting...
del "C:\Temp\"%Username%"\16Staff.accdb"
del "C:\Temp\"%Username%"\16Staff.laccdb"
del "C:\Users\"%Username%"\AppData\Local\Microsoft\Office\Access.officeUI"
c:
cd\
echo Creating Temp folder...
Md "C:\Temp"
MD "C:\Temp\"%UserName%
echo Copying...
xcopy /y "R:\Staff\Access.officeUI" "%USERPROFILE%"\AppData\Local\Microsoft\Office\
copy "R:\Staff\16Staff.accdb" "C:\Temp\"%Username%
echo Loading...
"C:\Program Files (x86)\Microsoft Office\Office16\MSAccess.exe" "C:\Temp\%Username%\16Staff.accdb"
EXIT
来源:https://stackoverflow.com/questions/60458913/multi-use-of-access