Unanswered: Replace the current running mde file with other mde file
I am on the process of distributing my application, compiled and stored in MS access 97 / 2000 myapp.mde format in the local folder. My application uses linked table to connect to shared data.
In that app, i has the function to check whether the version of running mde file is the newest version or not. If there is a newer version stored in the shared network: //myserver/sharefolder/myapp.mde, the application will ask the user to upgrade to new version (done).
The problem I has is to replace the running old app to the new one. The current running application must be closed, then the file will be replaced with the newer version, and then reopen with the same user log in.
You cannot replace an mde when it is still open and executing code. So you can do the following:
1. From inside the old mde
- download the new version to a temporary location/name (.new)
- launch an external update.bat (Shell "update.bat")
- close the application/terminate access session
2. From inside the batch file
- wait until the application is closed/access is terminated (this may be achieved by some program which checks if a certain program (Access) is running or not and returns a return value which can be evaluated inside the batch script)
- rename the old .mde to .old
- rename the .new to .mde
- launch the application again
If you do not know of a program which checks for a running process and returns an appropriate code, you can use a simple "pause" instruction to cause the batch file to wait until the user presses a key and instruct the user to only press a key if Access is indeed terminated...