# GZipStream in VBA?



## Gregor1234 (Jun 3, 2004)

Is it possible to reference GZipStream from Access VBA? if so what reference do I need to add?

I can't seem to find the right reference.


----------



## Rollin_Again (Sep 4, 2003)

What don't you just use late binding and create an object? As long as your know the properties and methods of the objects you can still work with them using VBA.

Regards,
Rollin


----------



## Gregor1234 (Jun 3, 2004)

Well, the problem is that I'm not exactly sure what I'm doing.

I assume you mean something like:

Dim Z as object

set Z = createobject("xxxx.gzipstream")

Well,for starters, I'm not sure what goes in "xxxx"

I'm working from several examples that are posted at MSDN and other places.

In the examples I've seen, they've used constructs like:

Dim X as New GZipstream(compressedbytebuffer, CompressionMode.Compress, True)

I am unfamiliar with this construct and am unsure what the arguments represent

Obviously the first argument is the destination for the compressed stream but I don't know what CompressionMode.Compressed is or what the True is suposed to represent.

If I could set a reference to the appropriate library, I might be able to bluff my way through.

Are you familiar with GZipStream? Can you fill in some of the blanks?


----------



## Rollin_Again (Sep 4, 2003)

Sorry, I don't know anything about GZipStream. What is it used for?

Regards,
Rollin


----------



## Rollin_Again (Sep 4, 2003)

Have you had a look here to see if the code provided does what you want?

http://msdn2.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx

Regards,
Rollin


----------



## Gregor1234 (Jun 3, 2004)

GZipStream is apparently a bytestreamn compress/decompress capability available in .NET

See http://msdn2.microsoft.com/en-us/library/system.io.compression.gzipstream(vs.80).aspx

In the examples they are using VB5

I have the .NET2 framework installed but am using Access VBA

When I use the "Imports" statments that they use, I get an Invalid Outside Procedure error message.

When I go to the references box, I see no entry that would indicate a .NET library.

I have a suspicion that you only get the exposed reference with Visual Studio .NET and I only have Office.

But, then again I'm not sure what I'm doing and I could be missing and answer that's staring me in the face.


----------



## Gregor1234 (Jun 3, 2004)

In the article they mention system.dll but adding that as a reference appers to have had no effect.


----------



## Rollin_Again (Sep 4, 2003)

Have you tried downloading and installing Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System. It includes compression libraries. You may also want to try to install .NET 3.0

http://www.microsoft.com/downloads/...B3-6FD6-4955-B979-E1676DB6B3CB&displaylang=en

Regards,
Rollin


----------



## Gregor1234 (Jun 3, 2004)

No I havent' but I will take a look at it. This may be the thing I am missing.

I have to sign off for the day now. Will try later or tomorrow.


----------



## Rollin_Again (Sep 4, 2003)

Keep us posted.

Regards,
Rollin


----------

