How do I automate back-up of an MS Access Database?

N

NeedAcessHelp

I need to know how to either create a macro within a form that will copy an
entire database and save it as another file that will act as a back-up
location. How can I do this either using Macros in Access or with Visual
Basic?
 
C

Chris Reveille

What I do is use visual basic on a form which opens when
you open the database. It appends todays date to the file
name. I use the Windows Task Scheduler to run this daily.
Before you can use the FileSystemObject you must set a
reference to the Windows scripting host in your vb references.
**********************************
Private Sub Form_Load()
Dim fso As Object
Dim boverwrite As Boolean
Set fso = CreateObject("Scripting.fileSystemObject")

fso.copyfile "\\path to and file name of file copying",
"path to and file name of destination " & Format(Date,
"mmddyy") & ".mdb"

Set fso = Nothing
MsgBox "*** All Files have Been copied ***", vbInformation, ""
End Sub
***************************************

Good Luck

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top