We help IT Professionals succeed at work.

Getting the 7Z zip dll to work with MS Access

Andy Brown
Andy Brown asked
on
766 Views
Last Modified: 2017-05-10
I need to use a reliable compression/decompression function with my Access application.  It needs to be able to encrypt, archive and extract to the various folders (all via VBA without users having to go outside of the application).

I started using 7za,exe, which seems to work fine, but it doesn't give me much control if there is a problem.  For example, if the users try to archive a ".accdb" file that is open,  

So, I thought it might be a good idea to use the 7z.dll or 7-zip.dll files, add a reference in Access and go from there.  The problem is that whenever I try to register (via regsvr32) 7z.dll, I get the following:

"The module "7z.dll" failed to load.
"Make sure the binary is stored at the specified path or debug it to check for problems with the binary or dependent .DLL files.

I tried different sources of the 7z files from SourceForge and 7-zip.org

Another site suggested registering "7-zip.dll" instead.  This worked fine and allowed me to register it.  However, when I went into Access, Tools, References - it wasn't on the list and when I browsed to it and selected the registered file, it said, "Can't add a reference to the specified file".

Anyone have any suggestions (it doesn't have to be 7Z - but it does need to be free to distribute and with the above functionality.
Comment
Watch Question

CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Bill PrewTest your restores, not your backups...
CERTIFIED EXPERT
Expert of the Year 2019
Top Expert 2016
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Software & Systems Engineer
CERTIFIED EXPERT
Distinguished Expert 2019
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Andy BrownDeveloper

Author

Commented:
Thank you everyone - I'm going to give the VB6 tool a try.
Bill PrewTest your restores, not your backups...
CERTIFIED EXPERT
Expert of the Year 2019
Top Expert 2016

Commented:
I'd be interested in how you make out with that Andy, if at some point you wanted to post back some results / experiences using it.

~bp
Andy BrownDeveloper

Author

Commented:
Will do.
Andy BrownDeveloper

Author

Commented:
This ended up taking longer than I wanted (plus I wanted to stay with the well know 7z tools).

The reason that I wanted a .dll option was so that I could verify that the files were written correctly (open files weren't skipped etc).  However, in the end, I found a way that was better for me.

I used the 7za.exe to add files to the archive, I then extracted those files to a temporary folder and verified that both the source and extracted archive files matched.
Bill PrewTest your restores, not your backups...
CERTIFIED EXPERT
Expert of the Year 2019
Top Expert 2016

Commented:
Interesting, I almost suggested that brute force "trust and verify" approach along the way but figure folks would snicker at me.  Glad you got something that works for you.


ยปbp
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.