zip (or other compress method) from inside Access

smig

Registered User.
Local time
Today, 23:32
Joined
Nov 25, 2009
Messages
2,209
I need a way to zip (or other compress method) a text file.
The compress method should work from inside Access. a DLL or OCX wll be the best

Thanks,


*** Edit ***
I found a free good one here :)
http://www.xstandard.com/en/documentation/xzip/
 
Last edited:
thanks HiTechCoach,
XZip is by far easier to use, as it only require 3 or 4 lines of code to be used (though it need to be registered in the system)
The main problem I found with is it's support for ASCII characters file names only. Hebrew file names won't work :(

Here I have no idea where to start. do I need to copy all the modules to my application to use it?
as I tested this one it works great with Hebrew files.
How do I ad several files to the Zzip file ?

Tal
 
I did some search about info ZIP and found that it has backword competability problems, as they don't keep it backword competible with each new version.
also it's bad documentation realy doesn't help me.

I also found that it is possible to create a ZIP file using theshell API
here some code I found
Code:
Option Explicit
 
Const FOF_SIMPLEPROGRESS = 256
Dim MySource, MyTarget, MyHex, MyBinary, i
Dim oShell, oCTF
Dim oFileSys
dim winShell
 
MySource = "C:\Documents and Settings\c9pxk1\Desktop\ZIP Test\FullFile.mdb"
MyTarget = "C:\Documents and Settings\c9pxk1\Desktop\ZIP Test\Backup of
FullFile.zip"
 
MyHex = Array(80, 75, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
 
For i = 0 To UBound(MyHex)
MyBinary = MyBinary & Chr(MyHex(i))
Next
 
Set oShell = CreateObject("WScript.Shell")
Set oFileSys = CreateObject("Scripting.FileSystemObject")
 
'Create the basis of a zip file.
Set oCTF = oFileSys.CreateTextFile(MyTarget, True)
oCTF.Write MyBinary
oCTF.Close
Set oCTF = Nothing
 
'Add File to zip
set winShell = createObject("shell.application")
winShell.namespace(MyTarget).CopyHere MySource
 
wScript.Sleep(5000)

works like a chram :)
not sure what MyHex is for
 
Last edited:
Thanks David,
Look at my first message. I already found X-Zip and found it to be real easy to use.
only problem (a big one for me :D) it won't support Hebrew file name (for the zipped files). I contacted the authour and he replied only ASCII characters are supported.

what can be better then using a simple system API that doesn't require any other DLL/OCX ?
That is my last find :)
I'll test it some more to see if I can find any problem with it.
As I tested it so far it seems to do a nice job and do support Hebrew.
 

Users who are viewing this thread

Back
Top Bottom