Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2003

    Question Unanswered: automatic daily back up of a network-based Access 97 database at Windows NT 4.0

    I have written some testing code to simply copy an existing database to another blank database.

    Private Sub Form_Timer()

    Dim cur_hr As Date
    Dim cur_min As Date
    Dim strNewFileName, strFileName, strFullTargetPath, strSourcePath As String
    Dim strOldEntirePath, strNewEntirePath As String
    Dim InResult As Long
    Dim BackupDB As Object
    cur_hr = Hour(Now())
    cur_min = Minute(Now())
    strFileName = "Secure TestMaster.mdb"

    strSourcePath = "J:\Melanie\SecureDatabase\"
    strFullTargetPath = "J:\Melanie\SecureDatabase\backup\"
    strOldEntirePath = strSourcePath + strFileName
    'If cur_hr = 12 Then
    If cur_min = 4 Then
    strNewFileName = Left(strFileName, InStr(1, strFileName, ".") - 1) & Format(Day(Now()), "yyyymmdd") & ".mdb"
    strNewEntirePath = strFullTargetPath + strNewFileName
    'BackupDB = CreateObject(strNewEntirePath)
    'BackupDB.Application.Visible = True

    FileCopy strOldEntirePath, "J:\Melanie\SecureDatabase\backup\backup.mdb"
    End If

    End Sub

    However, as this Access 97 databse (Secure TestMaster.mdb) is in Secure mode and it is password-protected with the loggin of the Adminisitrator account.Permission is denied to copy the database, So how can I solve this problem?

    On the other hand, this is a network-based database and how can I enable the database to do daily backup automatically even though all the computers in the office have been shut down duirng mid-night?
    If it is infeasible, how can I implement a similar function in the situation that only the Form where I write the VBA or Access 97 is closed? I tried such function using NT scheduler (OS is Windows NT) but it didn't work again due to the security of password to open Access, Thanks,

  2. #2
    Join Date
    Jul 2003
    Try doing it from outside Access. Create a .BAT file containing this line:

    COPY ""J:\Melanie\SecureDatabase\Newfile.mdb" ""J:\Melanie\SecureDatabase\backup\backup.mdb" /Y

    Use MS Scheduler to call this .BAT file. It should copy it without any regard to Access security.
    Inspiration Through Fermentation

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts