Results 1 to 2 of 2

Thread: create backup of database

  1. #1

    Thread Starter
    Fanatic Member Navarone's Avatar
    Join Date
    Jun 2003
    Location
    Akron, Ohio USA
    Posts
    740

    create backup of database

    I have a script in my program that makes a back up of the existing db.

    Code:
    'make a back up of the existing db and rename it.
        If Dir("C:\WestfieldInsurance\old_Westfield.mdb", vbNormal) = "" Then
           fso.CopyFile App.Path & "\" & "Westfield.mdb", "C:\WestfieldInsurance\old_Westfield.mdb", True
        Else
           'MsgBox ("file exist")
        End If
    I want to change this script and was thinking of a way to add a date and time to the db name so if I need to restore a previous db from certian date or time, I could. I hope that makes sense.
    He who never made a mistake never made a discovery?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: create backup of database

    Try using something like
    Code:
    App.Path & "\" & "Westfield.mdb", "C:\WestfieldInsurance\old_Westfield" & format(now, "mmddyyyy") & ".mdb"

Posting Permissions

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



Click Here to Expand Forum to Full Width