N/APosted on - 04/06/2012
I want to add backup and restore function in my VB6.0 project. I want the program to create a backup folder containing the backup file of my access database in drive C: of my computer upon clicking the backup button.
I also want to add restore function so that if I accidentally deleted the to my backup folder, I can restore it.
Please let me have the simplest code for this. Thanks.
Backup and restore function in Visual Basic 6.0
All you need is backing up and restore of a database records. There are various ways by which you attain it.
1. Copy the access file to another directory.
2. For each record of a database, Copy it to same other format (encrypting) to some other file.
The first solution which is achieved using the File_Copy method found inbuilt in libraries of VB 6.0.
The next solution is achieved by connecting to the database and then if you are using ADODC, then
<write to a file the entire record>
When you retrieve the file then first solution is copy the file back to the path.
Next Solution replace/append all entries of the file into each record of the database using adodc1.recordset.addnew
<copy the file data to the record attributes>
Continue this for the whole file.