473,796 Members | 2,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ZIP code module without DLL dependencies???

Hi Everyone,

I am trying to find a solution for handling zipped data without the
need to ship / install any DLL files with the database. Does anybody
know of code to handle ZIP files that does not require any external
references? If I can ship it 'built-in' as either a class module or
standard module then that would be perfect.

Any help would be greatly appreciated.

Cheers

The Frog
Nov 19 '07 #1
36 3118
On Mon, 19 Nov 2007 01:56:00 -0800 (PST), The Frog
<Mr************ @googlemail.com wrote:

That would require you to implement the zip file format and zip
decompression in VBA. Good luck with that.

-Tom.

>Hi Everyone,

I am trying to find a solution for handling zipped data without the
need to ship / install any DLL files with the database. Does anybody
know of code to handle ZIP files that does not require any external
references? If I can ship it 'built-in' as either a class module or
standard module then that would be perfect.

Any help would be greatly appreciated.

Cheers

The Frog
Nov 19 '07 #2
I cannot find it right now but I have downloaded a VB6 class that supports
the ZIP file format. A Google search for "Zip Visual Basic class" should get
you started.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"The Frog" <Mr************ @googlemail.com wrote in message
news:58******** *************** ***********@d61 g2000hsa.google groups.com...
Hi Everyone,

I am trying to find a solution for handling zipped data without the
need to ship / install any DLL files with the database. Does anybody
know of code to handle ZIP files that does not require any external
references? If I can ship it 'built-in' as either a class module or
standard module then that would be perfect.

Any help would be greatly appreciated.

Cheers

The Frog

Nov 19 '07 #3

Create, extract, or both?

If the target machine is XP SP2, then all the DLLs you need are
already installed.

(Although to be honest, I've only does this with a VBScript file, not
in VBA.)

On Mon, 19 Nov 2007 01:56:00 -0800 (PST), The Frog
<Mr************ @googlemail.com wrote:
>I am trying to find a solution for handling zipped data without the
need to ship / install any DLL files with the database. Does anybody
know of code to handle ZIP files that does not require any external
references? If I can ship it 'built-in' as either a class module or
standard module then that would be perfect.
Any help would be greatly appreciated.
Please Post Any Replies To This Message Back To the Newsgroup.
There are "Lurkers" around who can benefit by our exchange!
Nov 20 '07 #4
Chuck Grimsby <c.*******@worl dnet.att.net.in validwrote:
>
Create, extract, or both?

If the target machine is XP SP2, then all the DLLs you need are
already installed.

(Although to be honest, I've only does this with a VBScript file, not
in VBA.)
Interesting. Got any URLs with VBScript code?

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Nov 20 '07 #5
On Tue, 20 Nov 2007 04:13:10 GMT, "Tony Toews [MVP]"
<tt****@teluspl anet.netwrote:
>Chuck Grimsby <c.*******@worl dnet.att.net.in validwrote:
>>Create, extract, or both?
If the target machine is XP SP2, then all the DLLs you need are
already installed.
(Although to be honest, I've only does this with a VBScript file, not
in VBA.)
>Interesting. Got any URLs with VBScript code?
I got the source for this somewhere in Usenet, although I've forgotten
where. I have the full message, but it's on a Backup disk somewhere.
(It's not exactly new!)

Some who *really* knows VBScript could probably do a better job, but
this works.

This creates a Zip file and copies the contents of a whole folder into
it. As always, watch out for word wrap....

---------------------- Cut Here ------------------------------------
Option Explicit
Dim ZipFileName, FolderToZip
Dim oApp, MyHex, MyBinary, i
Dim oFSO, oTF

MyHex = Array(80, 75, 5, 6, 0, 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

FolderToZip = "C:\Data Files\My Data\"
' in case someone forgets the last slash:
If Right(FolderToZ ip, 1) <"\" Then
FolderToZip = FolderToZip & "\"
End If

ZipFileName = "G:\Backups \" & _
FormatNowISO & _
"MyDataBackup.z ip"

'Create empty Zip File
Set oFSO = CreateObject("S cripting.FileSy stemObject")
Set oTF = oFSO.CreateText File(ZipFileNam e, True)
oTF.Write MyBinary
oTF.Close
Set oTF = Nothing
Set oFSO = Nothing

'Copy the files to the compressed folder
Set oApp = CreateObject("S hell.Applicatio n")
oApp.NameSpace( ZipFileName).Co pyHere _
oApp.NameSpace( FolderToZip).it ems

'Keep script waiting until Compressing is done
On Error Resume Next
Do Until oApp.NameSpace( ZipFileName).it ems.Count =
oApp.NameSpace( FolderToZip).it ems.Count
Application.Wai t (Now + TimeValue("0:00 :01"))
Loop
Set oApp = Nothing
On Error GoTo 0

'MsgBox "Done!" & vbnewline & _
"You'll find the zipfile here: " & vbnewline & _
ZipFileName

WScript.Quit

Function FormatNowISO
FormatNowISO = DatePart("yyyy" , Now())
FormatNowISO = FormatNowISO & Right("00" & DatePart("m", Now()), 2)
FormatNowISO = FormatNowISO & Right("00" & DatePart("d", Now()), 2)
' if the time is needed:
'FormatNowISO = FormatNowISO & _
Right("00" & DatePart("h", Now()), 2)
'FormatNowISO = FormatNowISO & _
Right("00" & DatePart("n", Now()), 2)
'FormatNowISO = FormatNowISO & _
Right("00" & DatePart("s", Now()), 2)
End Function
---------------------- Cut Here ------------------------------------

I'll have to dig out the backup to get at a un-zip script. As I
remember, it's pretty much the same thing, just copying the files out
of the (zipped) folder. I'll see if I can dig it out over the
Thanksgiving holiday.

Please Post Any Replies To This Message Back To the Newsgroup.
There are "Lurkers" around who can benefit by our exchange!
Nov 21 '07 #6
"Stephen Lebans" <ForEmailGotoMy .WebSite.-WWWdotlebansdot ...@linvalid.co mwrote:
>A Google search for "Zip Visual Basic class" should get
you started.
Nope. way too many hits without the quotes and way too few hits with the quotes.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Nov 21 '07 #7
Chuck Grimsby <c.*******@worl dnet.att.net.in validwrote:
>>Chuck Grimsby <c.*******@worl dnet.att.net.in validwrote:
>>>Create, extract, or both?
If the target machine is XP SP2, then all the DLLs you need are
already installed.
(Although to be honest, I've only does this with a VBScript file, not
in VBA.)
>>Interesting . Got any URLs with VBScript code?

I got the source for this somewhere in Usenet, although I've forgotten
where.
Thanks but I suspect that could be quite difficult to convert to VB/VBA. I suspect
that VBScripts opening of a .zip file is a lot more intelligent than would be
VB6/VBA.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Nov 21 '07 #8
"Tony Toews [MVP]" <tt****@teluspl anet.netwrote in message
news:vu******** *************** *********@4ax.c om...
Thanks but I suspect that could be quite difficult to convert to VB/VBA.
I suspect
that VBScripts opening of a .zip file is a lot more intelligent than would
be
VB6/VBA.
Actually it wasn't too bad:

Sub CreateZip()
ZipFileName = "c:\temp\test1. zip"
FolderToZip = "c:\temp\testzi p\"

HexArray = Array(80, 75, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0)
For i = LBound(HexArray ) To UBound(HexArray )
BinStr = BinStr & Chr(HexArray(i) )
Next
Open ZipFileName For Output As 1
Print #1, BinStr
Close 1

Set oApp = CreateObject("S hell.Applicatio n")
oApp.NameSpace( ZipFileName).Co pyHere oApp.NameSpace( FolderToZip).it ems
Do Until oApp.NameSpace( ZipFileName).it ems.Count =
oApp.NameSpace( FolderToZip).it ems.Count
DoEvents
Loop
Set oApp = Nothing
End Sub

Although I've yet to find a way to copy individual files into the zip, other
than creating a folder, copying the files into it, then specifying this as
the source folder for the copy (which could be done transparently, but it's
a bit kludgy).
Nov 21 '07 #9
"Stuart McCall" <sm*****@myunre albox.comwrote:
>Thanks but I suspect that could be quite difficult to convert to VB/VBA.
I suspect
that VBScripts opening of a .zip file is a lot more intelligent than would
be
VB6/VBA.

Actually it wasn't too bad:
No, that wouldn't have been bad at all. However I'm slightly skeptical that the
VBScript object would work in all systems. While I doubt I have any Win 2000 clients
left there could be some. And I'm just a skeptic.

So I think I'll use the infozip dlls so long as they will work if copied into the
same folder as the FE MDE. I do not want to worry about them having to be installed
in the system32 folder.
>Although I've yet to find a way to copy individual files into the zip, other
than creating a folder, copying the files into it, then specifying this as
the source folder for the copy (which could be done transparently, but it's
a bit kludgy).
Interesting that.

Thanks, Tony

--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Nov 21 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2365
by: Robin Cull | last post by:
Hi all, I'm writing a script that needs to do lookups on the UNIX passwd and groups file on textual usernames/group names and return numeric UID/GID. Something that gives access to the C standard libarary functions getent(), for example. I've Googled around on various logical search terms and looked through pydoc and the module reference but haven't found anything up to this point. I'd have thought that the os module would provide...
2
2586
by: Robert Rothenberg | last post by:
I am working on a module that when given a CPAN distribution, will return which modules the distribtion requires (by parsing the Makefile.PL using Module::MakefilePL::Parse if the META.yml file is not available). A companion module will actually try to fetch the distribution information from CPAN (since it can query a .meta file if it exists before downloading an entire distribution). Because it is more closely tied to CPAN and works...
67
4286
by: Steven T. Hatton | last post by:
Some people have suggested the desire for code completion and refined edit-time error detection are an indication of incompetence on the part of the programmer who wants such features. Unfortunately these ad hominem rhetorts are frequently introduced into purely technical discussions on the feasibility of supporting such functionality in C++. That usually serves to divert the discussion from the technical subject to a discussion of the...
109
5936
by: Andrew Thompson | last post by:
It seems most people get there JS off web sites, which is entirely logical. But it is also a great pity since most of that code is of such poor quality. I was looking through the JS FAQ for any question that identifies the warning signs to look out for, the things that most easily and clearly identify the author of code as something less than a master of the art. I did not find an FAQ that answered it, but I think the FAQ
1
2266
by: John | last post by:
Hi First of all apologies for posting so much code but this is rather involved and I am totally stumped. Basically I have a main form (Staff Batch SMS/E-Mail) which calls a function (SendSMS) in a module with in turn calls a form (frmInet) which contains an ms internet control (Inet1). Problem is that once the function Send SMS returns and the code tries to close the main form a 'Runtime error 2486: You can't carry out this action at...
6
2348
by: TPJ | last post by:
Help me please, because I really don't get it. I think it's some stupid mistake I make, but I just can't find it. I have been thinking about it for three days so far and I still haven't found any solution. My code can be downloaded from here: http://www.tprimke.net/konto/PyObject-problem.tar.bz2. There are some scripts for GNU/Linux system (bash to be precise). All you need to know is that there are four classes. (Of course, you may...
2
1353
by: Thomas Girod | last post by:
Hi. I found a lot of documentation about how to code in Python, but not much about how you organize your code in various modules / packages ... As I am not yet used to python, this puzzle me a bit. So, can anyone explain how one should organize and store its code ? the uses of __init__.py files ? Maybe my question is not very clear, but I hope someone will understand anyway ...
34
1928
by: Alan Larsson | last post by:
Is there a way i can look at the php code that is runnig a site, without any ind of admin access to the server?
0
2025
by: Rich Healey | last post by:
AON LAZIO wrote: Aon, Please keep these replies on list (I've CC'd the list now). This isn't actually a very long error message, but since email is a scrollable medium including long messages often isn't too bad. If you're worried, include a link to a pastebin.
0
9531
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10187
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7553
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6795
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.