The copy may be corrupt if anyone has the database open at the time you make
the copy. You can add a line to check that the .ldb file does not exist
before making the copy. This is an example from a command file a user runs
interactively to make a local copy of the backend data, but you could adjust
it for your scheduled task:
@echo off
REM Cannot make a valid copy while database is in use
if Exist \\MyServer\MyShare\MyBackendData.ldb Goto DatabaseInUse
REM Create the backup folder in case it does not already exist.
mkdir C:\DBBackup
copy "\\MyServer\MyShare\MyBackendData.mdb" "C:\DBBackup\"
REM Let the user see the results. NOTE: Do NOT do this in a scheduled task.
pause
exit
atabaseInUse
echo ERROR: Cannot copy database file while program is being used.
pause
exit
- Show quoted text -