How to back up database in specific location and time automaticall

J

Jon

Greeting,

I have a database that I want it to be backup every day and in selected
location.

Any Help Please??
 
J

Jack Cannon

Jon,

Use the Windows Task Scheduler to execute a Bat file that copies the
database from A to B.

Jack Cannon
 
J

Jon

Hi Jack thank you for replying, but my Database on shared folder at the
company network!! Please advice??
 
J

John W. Vinson

Hi Jack thank you for replying, but my Database on shared folder at the
company network!! Please advice??

If your company isn't totally and absurdly incompetent, they should have their
shared folders backed up routinely! Contact your IT department and find out
their backup procedures.

Do note that Access databases should only be backed up when NOBODY is using
the database. A backup copy made while the database is in use runs a higher
risk of being corrupt (i.e. if an update process was half done at the time).
 
P

Paul Shapiro

For a very low-tech version, you can schedule a batch file to run whenever
you want. The batch file should only copy the mdb if there is no .ldb file.
Presence of an .ldb file indicates an active user, and as John said, the
copy will frequently be corrupt and unusable. Here's a batch file I've
installed for clients to interactively make local backups of the mdb from
the server to their workstation. You would omit the 'pause' statements if
you're scheduling it to run unattended, and you would probably want to add
some kind of logging.

@echo off
REM Cannot make a valid copy while database is in use
if Exist \\ServerName\ShareName\DBName.ldb Goto DatabaseInUse

echo Copying database to local disk...
copy "\\ServerName\ShareName\DBName.mdb" "C:\BackupFolderPath\DBName.mdb"
pause
exit

:DatabaseInUse
echo ERROR: Cannot copy database file while application is being used.
pause
exit
 
J

John W. Vinson

Here's a batch file I've
installed for clients to interactively make local backups of the mdb from
the server to their workstation.

Nice, Paul. With your caveats that should work just fine!
 
Top