BACKING UP ACCESS DATABASE

G

Guest

I'd like to backup my Access database automatically (no user intervention
needed) to an external drive. Does Access allow such a backup while the
database is "open" ? If I have to log out of Access, it defeats my purpose of
wanting to do the backup without user intervention. There appear to be a
number of drives and SW available to do the backup, but the question is
whether Access will allow it. Basically I'd like to backup to the external
drive every time a record is changed. I'm worried about losing my database if
the PC crashes.
 
A

Arvin Meyer [MVP]

If your database is that mission critical, it would pay to put it on a
server. SQL-Server can do automated backups every hour or so, if that's what
you want.

Backing up that frequently is a bit paranoid though. I typically backup once
per day. But the answer to your question is yes, you can write code in the
form that commits the record to back up the file. You CANNOT run code from a
table or query, so you must do it from forms.

Backing up open files is a bit dangerous. You might corrupt the copy, I've
not had that happen, but it is possible. Most backup systems avoid open
files. That said, use the FileCopy method to backup. I'd do it in a Standard
Module so it can be called from any form.:

Public Sub Bakup()
FileCopy CurrentDB.Name, E:\Backups\Format(Now,"mm/dd/yy hh:nn:ss" & ".mdb"
End Sub

Private Sub Form_AfterUpdate()
Backup
End Sub
 
G

Guest

I am using a similar method to backup the BackEnd, (no problem with loosing
the FrontEnd) everytime auser opens the FE - the code is on the start up form
which also runs every four hours. Just to understand your previous reply to
this post, if the BE is open when the code runs, am I risking corruption to
the Copy or the original back end?

I welcome your thoughts or any alternative approach.
 
A

Arvin Meyer [MVP]

Tom Ventouris said:
I am using a similar method to backup the BackEnd, (no problem with loosing
the FrontEnd) everytime auser opens the FE - the code is on the start up
form
which also runs every four hours. Just to understand your previous reply
to
this post, if the BE is open when the code runs, am I risking corruption
to
the Copy or the original back end?

I welcome your thoughts or any alternative approach.

Yes, any open file risks corruption if a write is being made during the
backup. It doesn't matter what kind of file. Access databases are
particularly prone because they are significantly larger and therefore
expose more opportunity for corruption.

I close the database and back it up every evening, or when I'm finished for
the day, and want to double up on backups by making one to carry with me
(offsite).
 
G

Guest

Thnak you.

Arvin Meyer said:
Yes, any open file risks corruption if a write is being made during the
backup. It doesn't matter what kind of file. Access databases are
particularly prone because they are significantly larger and therefore
expose more opportunity for corruption.

I close the database and back it up every evening, or when I'm finished for
the day, and want to double up on backups by making one to carry with me
(offsite).
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 

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