Results 1 to 6 of 6

Thread: making and restoring backups

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    74
    Hi! I have a simple newbie question.

    I just made my first database application, I'm currently using VB6 and access 97. I want to be able to save and restore backups of the database. What's the best way of doing this?

    Is is possible for the user of my program to be able to save the database in a different directory and/or different name? Similar to saving a word document file. I also want the user to restore/open any database saved by the application. Similar to opening a word document.

    Is this the right approach in doing this? Or is there a better way?

    Thanks in advance for all the help

  2. #2
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    If you are just using Access, the .mdb file will contain all code and data. If you are using VB as well, you will need all the runtime files that your package wizard has probably cocked up and the .EXE - the runtime stuff is readily available, but ensure that you have a copy of the .EXE and the original project/forms (i.e. .FRM, .VBP etc., in case you have to rebuild.

    BTW, If you are doing it for a client, keep a copy yourself. I once had a situation where I assigned copyright, handed over the code, destroyed my copies and they lost the files. Making changes from just the .EXE was quite diff.!

    Cheers,
    Paul
    Not nearly so tired now...

    Haven't been around much so be gentle...

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    74
    Thanks for the advice, but what I meant with the backups is I wanted to implement a feature in my program where the user of the program can save and restore the main database of the application.

    Sorry if my question was unclear

  4. #4
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    For the database portion check out the Compact and Repair options in Access. You will have to close the database and then compact into a new file. You can then get the user to select a directory/filename to compact into. perfectly good way of doing it.

    Good chance to let them access the Repair functionality in Access as well, they WILL need it at some stage.
    Not nearly so tired now...

    Haven't been around much so be gentle...

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    74
    Thanks i'll go look at that, is there a way though to do that through VB code?

  6. #6
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    Call the appropriate methods through Automation using Access as an object

    i.e.
    Dim oApp As Access Application
    Set oApp = New Access Application

    Dim db As Database
    Set db = OpenDatabase(...)
    db.Compact (or something)

    I can't quite remember the syntax, but look up Compact and Repair.

    Cheers,

    Paul.
    Not nearly so tired now...

    Haven't been around much so be gentle...

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