Results 1 to 11 of 11
  1. #1
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295

    How to check if there is .mdb file in a .zip file using VBA?


    Is there a way to check if there is .mdb file in a .zip file using VBA?

    what controls do I need to peek inside a .zip file?

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    don't zip files act like folders when you click on them? I wonder if you can treat it like a folder, use the mso folderpicker and then list the file extensions in it? Have you tried that already?

  3. #3
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    What is mso folderpicker? how to setup it?
    my .zip files are showing as regular files, if I click on one of them, winzip window pops up.

  4. #4
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    I set the property of .zip to be opened with windows compress folder, seems close to what I want, I am trying in VBA code if i can treat it as a normal folder.

  5. #5
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    i beleive the code is:
    Code:
    dim f as object
    
    set f = application.msofolderpicker

  6. #6
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    sorry, this is the code:
    Code:
    Application.FileDialog(msoFileDialogFilePicker)

  7. #7
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    can not use dir() to look inside a .zip folder.
    trying Application.FileDialog(msoFileDialogFilePicker)

  8. #8
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    I don`t want to show a dialogbox, I just want to check if there is any .mdb file. if there is, i may need to extract it out.

  9. #9
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    It's a bit on the clunky side, but I'd make a Shell Script (or BATCH file) that extracts a list of files inside the Archive and then saves that list to a text file somewhere. Then you can import/parse that file in Access however you want (although, I'd probably do the parsing in the Script/BATCH file myself).

    WinZip has a Command Line version that you can use in your Scripts, or you can do a search for Win32 ports of GNU's zip or bzip2.

    I know for a fact that any of those three can list files inside a ZIP archive.

  10. #10
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    I tried this for you weekend: http://allenbrowne.com/ser-59.html

    It doesn't seem to work on zip files. There can't be an extension portion in the name or it fails...

  11. #11
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    Thank you for all you help. I may do it manually since it should be a one time work, although there a hundred files.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 03-02-2010, 12:02 PM
  2. .DB file
    By 7iron in forum Access
    Replies: 1
    Last Post: 01-22-2010, 01:49 PM
  3. Upload file inside .mdb database file
    By havish in forum Access
    Replies: 0
    Last Post: 07-30-2008, 07:35 AM
  4. Possible to export *.mdb file to *.exe file?
    By slpuiwan in forum Import/Export Data
    Replies: 1
    Last Post: 12-16-2007, 06:52 PM
  5. How do you export a file with a unique file name
    By Budman42 in forum Import/Export Data
    Replies: 1
    Last Post: 10-15-2006, 06:10 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
  •  
Other Forums: Microsoft Office Forums