Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003

    Unanswered: Replace the current running mde file with other mde file

    Dear all,

    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.

    I try many thing like:

    - CloseCurrentDatabase
    - File Copy
    - Shell

    But without success

    Very appreciate your help


  2. #2
    Join Date
    Mar 2005

    Wink launch external batch

    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...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts