Backup via menu?

  • Thread starter Thread starter Rustle
  • Start date Start date
R

Rustle

What's the simplest way to run a backup via code? I want to add a
button to my switchboard to back up the database at the end of the
night. I am satisfied with the way the Backup Database... function
works via the File menu, but I don't know how to call that item or if
there's a better way. The dialog it calls up to do the backup lets
you save it to a default directory and then automatically renames the
file if a backup already exists to something like
DatabaseBackup_040108(1) if DatabaseBackup_040108 already exists.
Also wondering if there's a way to add the time, too.

Any ideas?
 
SQL Server has a maintenance plan wizard that can easily configure all
of this for you.

-aaron
 
Rustle said:
What's the simplest way to run a backup via code?

When the user exits the FE attempt to rename the backend MDB
preferably with todays date in the name in yyyy-mm-dd format. Ensure
you close all bound forms, including hidden forms, and reports before
doing this. If you get an error message, oops, its busy so don't
bother. If it is successful then compact it back.

See my Backup, do you trust the users or sysadmins? tips page for more
info.
http://www.granite.ab.ca/access/backup.htm

Note that Aaron's answer to every question involves the use of ADP
and/or SQL Server no matter how appropriate.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
Back
Top