Click to See Complete Forum and Search --> : making and restoring backups
gin
Nov 13th, 2000, 08:29 AM
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 :)
paulw
Nov 13th, 2000, 08:49 AM
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
gin
Nov 13th, 2000, 09:26 AM
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 :D
paulw
Nov 13th, 2000, 09:31 AM
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.
gin
Nov 13th, 2000, 09:49 AM
Thanks i'll go look at that, is there a way though to do that through VB code?
paulw
Nov 14th, 2000, 04:55 AM
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.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.