Backup & Restore using ZIP (1 Viewer)

Status
Not open for further replies.

keiths

Registered User.
Local time
Today, 08:14
Joined
Feb 10, 2005
Messages
28
I came across a very neat activex dll that can be used for zipping and unzipping files (especially backend databases). The nice thing about this one is it works very well with access. The other nice thing is that it is free.
:D
Go to the following url: http://xstandard.com

In their products listing is an activex dll called "zip component".

Here is some basic information on using it. The specs, documentation and other information is provided on their web site.

1) Copy the dll to a folder or location of your choice. Use regserver or a utility to register it.

2) In the database you wish to use it, open a module. Select Tools - References. Find a listing for "XStandard - Zip 2.5" and check it. Select OK. Compile the module.

You are now ready to use it in your vba code. Here is a simple example that works for zipping a backend database.

Public cp as XZip.Zip

Function BackMeUp()

Set cp = New XZip.Zip

cp.Pack "C:\testdata\backend-db.mdb", "C:\backup\backup.zip"

Set cp = Nothing

End Function

That is it. A couple lines of code, and it works well. Of course, you can do similar stuff with unzipping. The instructions cover the basic info you need. It works well with string variables, etc etc.

There has been a lot of discussion in the past surrounding this issue. I have tried a lot of different dll's, ocx's etc in the past year. This one is pretty seamless. I am sure anyone interested can come up with lots of ideas while using this.

This company also has a couple of other items that access programmers will find interesting and useful. Maybe someone can post information on their use here as well.
 

bonekrusher

Registered User.
Local time
Today, 07:14
Joined
Nov 19, 2005
Messages
266
I would like to add a little more to this post. This is a great way to zip contents. I use this with Ghudson browsing example to gather the folder contents. I gather the contents of the folder and record the links in a table called "holdtable". It will drop the zip contents in a folder called "Backups" which resides in the same folder as the database. It will name the zip file "File Folder Backup-date.zip"

Once its done, it deletes the "holdtable"

Here is the code to zip the links in the "holdtable":

Code:
Dim objZip As ZIP 'uses xstandard xip 2.4 dll
Dim rrst As DAO.Recordset
Dim dfol As String
Dim strDayPrefix As String
strDayPrefix = Format(Date, "mm-dd-yyyy")


pathloc = "File Folder Backup-" & strDayPrefix
pathb = path & "\backups\"
dfol = pathb & pathloc 

Set objZip = New XZip.ZIP
Set rrst = CurrentDb.OpenRecordset("holdtable")

    While Not rrst.EOF
    objZip.Pack rrst![Hold], dfol & ".zip", , 9
    rrst.MoveNext
    Wend

DoCmd.SetWarnings False
DoCmd.OpenQuery ("deletetable")
Set objZip = Nothing
 
Status
Not open for further replies.

Users who are viewing this thread

Top Bottom