Backup and restore function in Visual Basic 6.0

Asked By 0 points N/A Posted on -
qa-featured

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.

SHARE
Answered By 0 points N/A #101920

Backup and restore function in Visual Basic 6.0

qa-featured

 

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
adodc1.recordset.movefirst
while adodc1.EOF=false
 <write to a file the entire record>
 adodc1.recordset.movenext
Wend
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>
adodc1.save
Continue this for the whole file.
 

Related Questions