Link to home
Start Free TrialLog in
Avatar of Andy Brown
Andy BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Getting the 7Z zip dll to work with MS Access

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.
SOLUTION
Avatar of als315
als315
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Andy Brown

ASKER

Thank you everyone - I'm going to give the VB6 tool a try.
Avatar of Bill Prew
Bill Prew

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
Will do.
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.
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