Main Topics
Browse All TopicsHow can I zip a file (a mdb file) without having winzip on the computer?
I cant use any other .dll just the internal windows zip method.
Thanks.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Thank sirbounty,
So with declarations - i have the following but with an error. If i turn off option explicit, it works - but i would rather everthing dim'ed:
Option Explicit
Dim objFSO As Object
Dim strPath As String
Const SHCONTF_NONFOLDERS = &H40
Private Sub form_load()
Set objFSO = CreateObject("Scripting.Fi
Compress ("C:\program files\bookingapp\real.mdb"
Set objFSO = Nothing
End Sub
Sub Compress(fil)
Dim strPath, strExt, strfile As String
strPath = Left(fil, InStrRev(fil, "\")) 'Acquire Path
strfile = Mid(fil, InStrRev(fil, "\") + 1) 'Acquire filename
strExt = Mid(strfile, InStrRev(strfile, ".") + 1, 3) 'Acquire extension
Dim strZip As String
strZip = strPath & Replace(strfile, "mdb", "zip")
Dim zipFil As Object
Set zipFil = objFSO.CreateTextFile(strZ
zipFil.WriteLine Chr(80) & Chr(75) & Chr(5) & Chr(6) & String(18, 0)
zipFil.Close
Dim oApp As Object
Set oApp = CreateObject("Shell.Applic
oApp.NameSpace(strZip).Cop
DoEvents
Set oApp = Nothing
Set zipFil = Nothing
'uncomment next line to delete file after zipped
'If objFSO.FileExists(strZip) Then objFSO.DeleteFile (fil) '- only delete source file is zip file is present
End Sub
Business Accounts
Answer for Membership
by: sirbountyPosted on 2007-01-11 at 10:12:45ID: 18294979
Try this...
leSystemOb ject") 'Create instance of FSO
")
ip) ation") yHere strPath & strFile
Dim objFSO, strPath
Const SHCONTF_NONFOLDERS = &H40
Set objFSO = CreateObject("Scripting.Fi
Compress ("C:\pathtofile\myfile.mdb
set objFSO=Nothing
wscript.quit
Sub Compress(fil)
strPath = Left(fil, InStrRev(fil, "\")) 'Acquire Path
strFile = Mid(fil, InStrRev(fil, "\") + 1) 'Acquire filename
strExt = Mid(strFile, InStrRev(strFile, ".") + 1, 3) 'Acquire extension
strZip = strPath & Replace(strFile, "mdb", "zip")
Set zipFil = objFSO.CreateTextFile(strZ
zipFil.WriteLine Chr(80) & Chr(75) & Chr(5) & Chr(6) & String(18, 0)
zipFil.Close
Set oApp = CreateObject("Shell.Applic
oApp.NameSpace(strZip).Cop
wscript.sleep 7000 '7 second pause for log file to be compressed - depending on size, increase this value
Set oApp = Nothing
Set zipFil = Nothing
'uncomment next line to delete file after zipped
' If objFSO.FileExists(strZip) Then objFSO.DeleteFile (fil) '- only delete source file is zip file is present
End Sub