Zipping files using VB - RESOLVED
I am creating a program to do my archiving on the first day of each month for the previous months data. I am wondering if it is possible using Visual Basic , to zip those files and move them to particular directories, without manually having to do each.
Can someone give me a hand as to where i would start. I am just confused on how to make VB zip a file. What references would i use?, etc. If possible can someone post a code snippet of how this may be done.
Thanks in advance
oobern
Re: Zipping files using VB
While there might be better ways, you could use the command shell to call the command-line ZIP utility.
Re: Zipping files using VB
2 Attachment(s)
Re: Zipping files using VB
Attached are two examples on how to zip/unzip files. Only 1 module, 1 dll and a small snippet of code for each. Very, very easy to use.
Re: Zipping files using VB
Re: Zipping files using VB
Who me? :confused:
No, VB6
Re: Zipping files using VB
the sample was written in vb5, or at least the module was.
Re: Zipping files using VB
Try using ARJ
Code:
dim x
x = shell("arj a -va c:\MyArchive.arj c:\Hello.mdb")
Re: Zipping files using VB
What would i use as a reference to use arj????
oobern
Re: Zipping files using VB
you don't need a reference if you call it using shell. I haven't used arj for years. i really liked it, back when nobody knew what it was even.
Re: Zipping files using VB
That sample from vbaccelerator (link was provided by NoteMe) is the best solution by far: wrapper dll is utilizing the same libraries that Winzip does and it works like a charm.
Re: Zipping files using VB
zip32.dll is from 1998. the ones with winzip 9.0 are Feb. 2004
I guess those are 16 bit?
Re: Zipping files using VB
It would be weird to call a dll for zip32.dll if it is 16bit isn't it? I havn't checked, but that would really be weird.
ØØ
Re: Zipping files using VB
the bas module says it was written in vb5
Re: Zipping files using VB
Quote:
Originally Posted by dglienna
zip32.dll is from 1998. the ones with winzip 9.0 are Feb. 2004
I guess those are 16 bit?
Rather than guessing you should try that thing. If I'm saying it works like a charm - means it works like a charm. Period. But what ever ...
EDIT: here is a quick info directly from vbaccelerator.
Updates: Introduction to the freeware Info-ZIP libraries
26 Jan 2003
Provided a new version of the Info-ZIP Zip32.DLL with encryption code compiled in. This enables you to create password-protected ZIP files.
1 Jan 2000
First Posted
Re: Zipping files using VB
OK, already. I'm up for anything at this point. I swore it'd work after it worked here.
It wasn't seamless, but it did work. Thanks.