Results 1 to 3 of 3
  1. #1
    ETCallHome is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2011
    Location
    Limpopo, South Africa
    Posts
    48

    Creating Backup of Tables/Database

    Hi,

    Not sure where this question must be posted! I would like to create code in VBA to backup tables in access. I am not sure where to begin, but what I would like to do is the following:

    When the user signs in I want to backup the database/tables
    When the user sign off I want to back up the database/tables.

    Could someone please help.

    Thanks

  2. #2
    ETCallHome is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2011
    Location
    Limpopo, South Africa
    Posts
    48
    Hi,

    Searching the whole day yesterday, I stumbled on some backup code in vba and it works great, however, I cannot find any restore code in vba to restore the database from the backup taken. As I would like the users to be in control of this package, they should be in a position to restore the database, as they themselve create the backup.

    Your help is much appreciated.

    Regards

  3. #3
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    This depends on how you're doing the backup. If I want to backup the mdb or accdb which has the backend tables, I'll use the FileSystemObject to just make a copy of the mdb or accdb file.

    See: https://www.accessforums.net/code-re...-vba-7693.html

    Restoring gets a little tricky if you have the backend in a separate mdb/accdb file since you most likely need to refresh the linked tables in the frontend after 'restoring' or copying/pasting the mdb/accdb which has the backend tables. If the backend/frontend are the same, you may want to consider creating a vb script to do the backup/restore (put the coding in the link above into a vb script file) and have them execute that or you can make it so it runs the vb script itself via a button on the form.

    See: https://www.accessforums.net/code-re...-vba-7694.html to run a vb script in vba coding (just change it from a word document to instead open your vb script instead.)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. access database backup...
    By alex_raju in forum Access
    Replies: 5
    Last Post: 07-17-2011, 09:00 AM
  2. Replies: 2
    Last Post: 03-02-2011, 06:50 AM
  3. Creating tables from scripts
    By accesscoder in forum Import/Export Data
    Replies: 6
    Last Post: 10-18-2010, 04:42 PM
  4. Database backup automation
    By aat in forum Access
    Replies: 2
    Last Post: 09-17-2010, 07:24 PM
  5. Making a backup copy of table or database
    By wasim_sono in forum Access
    Replies: 0
    Last Post: 03-09-2006, 05:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums