Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatic backup of database using ARJ

Status
Not open for further replies.

RollyS

Programmer
Jan 28, 2001
42
PH
I need to know how to do this:

After every session of my app, my app will automatically run the ARJ.exe (a compression tool using DOS) in order to create a backup of the database (say the database is located in c:\<my app>\Data.). Then, of course, I should also be able to extract the ARJ file in my app when needed. I want to do this all in code.

Does anybody know how to do this? I'd be very appreciative of anyone who would share me how to do this.
 
Put your call to ARJ (or PKZIP, or whatever) in a .BAT file. In your code, call the Shell command with the path to the BAT file.

By using the BAT file, you can add in additional DOS/NT commands to do things like rename files, connect to network drives, etc.

For when you want to recover your data from your archive, create another .BAT file to extract your stuff from your .ARJ file and put it where your program can find it. Again, you can add additional command-line functions to copy, move, rename files before/after calling ARJ.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top