Zipping files using VB - RESOLVED-VBForums
Results 1 to 16 of 16

Thread: Zipping files using VB - RESOLVED

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2004
    Posts
    44

    Resolved 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
    Last edited by oobern; Feb 15th, 2005 at 12:30 PM. Reason: RESOLVED

  2. #2
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,958

    Re: Zipping files using VB

    While there might be better ways, you could use the command shell to call the command-line ZIP utility.
    Don't solve problems which don't exist.

    "If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)

    2 idiots don't make a genius.

  3. #3
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,191

    Re: Zipping files using VB

    Nice article for you on the topic...


    http://www.vbaccelerator.com/home/VB...es/article.asp



    ии

  4. #4
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    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.
    Attached Files Attached Files

  5. #5
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Zipping files using VB

    using VB5 no less?

  6. #6
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: Zipping files using VB

    Who me?

    No, VB6

  7. #7
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Zipping files using VB

    the sample was written in vb5, or at least the module was.

  8. #8
    Addicted Member
    Join Date
    Oct 2004
    Location
    Philippines
    Posts
    137

    Re: Zipping files using VB

    Try using ARJ

    Code:
    dim x 
    
        x = shell("arj a -va c:\MyArchive.arj c:\Hello.mdb")

  9. #9

    Thread Starter
    Member
    Join Date
    Dec 2004
    Posts
    44

    Re: Zipping files using VB

    What would i use as a reference to use arj????

    oobern

  10. #10
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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.

  11. #11

  12. #12
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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?

  13. #13
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,191

    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.




    ии

  14. #14
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Zipping files using VB

    the bas module says it was written in vb5

  15. #15
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,135

    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

  16. #16
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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.
    Last edited by dglienna; Feb 12th, 2005 at 02:34 PM.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.