[AccessD] Backup routines

Carlos Alberto Alves caa at highway.com.br
Thu Feb 26 21:13:18 CST 2004


On Wed, 25 Feb 2004 18:17:45 -0800, Arthur Fuller <artful at rogers.com> 
wrote:

> IMO daily backup routines are not overzealous. At my last place of
> employ we did more than one daily backup (of the database), in fact: at
> noon, at 5pm and at midnight. Each morning the midnight copy was burned
> to a CD and taken off-site.
>
> We never had to use one of them in 3+ years. But there's a security in
> knowing that even if the whole building burns down, there's an offsite
> backup that can take us back to last midnight.
>
> Arthur
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Carlos
> Alberto Alves
> Sent: Tuesday, February 24, 2004 4:00 AM
> To: AccessD List
> Subject: [AccessD] Backup routines
>
>
> Dear Members:
> I would like to have your input on this subject. I wrote a Sub to
> execute
> regular BE backups. Everyday thru a month a BE copy is compacted
> (DBEngine.CompactDatabase) and renamed and stored in a different folder.
>
> Do you think that such a 30-day backup routine is overzealous??? Thanks
> for your opinion,

Thanks for all replies. Answering some questions, there is a network 
backup routine that overwrites last week backup (i.e.: this Monday backup 
overwrites last Monday backup), it is performed on removable tape, users 
got a corrupted database and all five copies were faulty too and there are 
no offsite copies. So I decided to set backup on a daily basis.
See code below...
>>>
Dim strPATH As String, strPATH_BKP As String, strCOMPACT As String
Dim strBD As String, strPREFIX As String, strTEMP As String, ReturnValue
strPATH = "your_forder"
strPATH_BKP = "new_folder"
strBD = "DB_name"
strCOMPACT = "BEFORE_COMPACT"
strTEMP = "TEMP"
strPREFIX = Format(Day(Date), "00")
ReturnValue = SysCmd(acSysCmdSetStatus, "your_msg")
If strPREFIX = 31 Then
      If Dir(strPATH_BKP & strCOMPACT & Chr(95) & strBD) <> "" Then
          Kill strPATH_BKP & strCOMPACT & Chr(95) & strBD
          DoEvents
      End If
      FileCopy strPATH & strBD, strPATH_BKP & strBD
      DoEvents
      Name strPATH_BKP & strBD As strPATH_BKP & strCOMPACT & Chr(95) & strBD
      DoEvents
      DBEngine.CompactDatabase strPATH & strBD, _
                               strPATH & strTEMP & Chr(95) & strBD, , , _
                               ";pwd=BD_PWD"
      DoEvents
      Kill strPATH & strBD
      DoEvents
      Name strPATH & strTEMP & Chr(95) & strBD As strPATH & strBD
      DoEvents
Else
      FileCopy strPATH & strBD, strPATH_BKP & strBD
      If Dir(strPATH_BKP & strPREFIXO & Chr(95) & strBD) <> "" Then
          Kill strPATH_BKP & strPREFIXO & Chr(95) & strBD
          DoEvents
      End If
      DBEngine.CompactDatabase strPATH_BKP & strBD, _
                               strPATH_BKP & strPREFIXO & Chr(95) & strBD, 
, , _
                               ";pwd=BD_pwd"
      DoEvents
      Kill strPATH_BKP & strBD
      DoEvents
End If
ReturnValue = SysCmd(acSysCmdClearStatus)
MsgBox "Backup completado com sucesso.", vbExclamation + vbOKOnly, "Backup"
>>>
;-)
-- 
**************************************
* Carlos Alberto Alves               *
* Child Neurologist                  *
* Systems Analyst/Programmer         *
* Rio de Janeiro, Brazil             *
* mailto:caa at highway.com.br          *
**************************************



More information about the AccessD mailing list