CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 1999
    Location
    Wisconsin
    Posts
    12

    Zip files with VB

    I have a program that processes data, and produces some files. Currently I have to zip these files by hand. Is there some code that allows me to zip these files through code?


  2. #2

    Re: Zip files with VB

    See http://www.xceedsoft.com for a great .dll and .ocx for this.


  3. #3
    Join Date
    Jul 1999
    Location
    Wisconsin
    Posts
    12

    Re: Zip files with VB

    I used your suggestion but I keep receiving an error message that states the following: "At least one 'warning' event was triggered because a recoverable error" I am using the following sample code that they provide. Any thoughts?

    Private Sub Command1_Click()

    Dim ResultCode As xcdError

    XceedZip1.ZipFilename = "L:\Data\Sample.zip"
    XceedZip1.FilesToProcess = "L:\Data\Sample\*.*"
    ResultCode = XceedZip1.Zip
    If ResultCode = xerSuccess Then
    MsgBox "Files zipped successfully."
    Else
    MsgBox XceedZip1.GetErrorDescription(xvtError, ResultCode)
    End If

    End Sub



  4. #4
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: Zip files with VB

    You could use my code from the CodeGuru site - it's all wrapped up in two class modules to handle zipping / unzipping and uses the freeware/gnu InfoZip DLL's

    Take a look at :

    [Old]http://codeguru.developer.com/vb/articles/1854.shtml[/Old]
    [Cimperiali: This is the new url...]
    http://www.codeguru.com/vb/gen/vb_gr...cle.php/c6743/

    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb
    Last edited by Cimperiali; October 28th, 2004 at 01:51 PM.

  5. #5
    Join Date
    Feb 1999
    Posts
    16

    I used your code Chris

    I downloaded your code Chris, made a few alterations and ran it. I worked brilliantly in VB6. I used exactly the same code in Access 2000 and the program appeared to work fine. I had one problem.........no zip file. No matter what I do, I cannot create the zip file from within MS Access 2000.

    Do you have any ideas as to why?

  6. #6
    Join Date
    Feb 1999
    Posts
    16

    I sorted out the above problem

    I copied the Zip32.dll and unZip32.dll in to the local path of the Access MDB. I actually needed to place it in the winnt\system32 directory. It works fine now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured