Sam,
From my files - see below my signature line.
--
PC Datasheet
A Resource for Access, Excel and Word Applications
(e-mail address removed)
www.pcdatasheet.com
· Design and basic development for new applications
· Additions, Modifications and "Fixes" for existing applications
· Mentoring for do-it-yourselfers who want guidance
· Complete application design and development
· Applications Using Palm Pilot To Collect Data And
Synchronize The Data Back To Access Or Excel
Programatically Zip And Unzip A MDB File
You can use the WinZip command line extensions to
silently/programmatically zip / unzip your .mdb. For instance, you can unzip
your file to a known location with wzunzip.exe, process it, and then rezip
it by shelling to wzzip.exe:
wkFile = Me.usFTPDest & Me.usISACTempFile
wkTemp = "C:/Progra~1/WinZip/wzzip.exe -s" & Me.usISACFtpPwd & " " &
Me.usFTPDest & Me.usISACFilename & " " & wkFile
OK = Shell(wkTemp, vbMinimizedNoFocus)
the winzip command line package contains full documentation on caommand line
parameters.
Just for fun, here's the full working function. It takes a text file,
compresses it using wzzip, protects the file with a password, and then FTP's
it out to a production server using the MSInet control. Hopefully the
variable names are self-documenting.
<compiled code>
Private Sub btnISACFileSend_Click()
Dim OK As Double
Dim wkSrc As String
Dim wkCmd As String
Dim wkVal As String
Dim wkTemp As String
Dim wkFile As String
Dim wkPath As String
Dim SQ As String
On Error GoTo ISACFileSendErr
SQ = "This will post MAP requests to the ISAC FTP server" & vbCrLf & _
"Do you wish to continue?"
If (MsgBox(SQ, vbYesNo, "Post MAP to ISAC") <> vbYes) Then GoTo
ISACFileSendExit
wkFile = Me.usFTPDest & Me.usISACTempFile
wkTemp = "C:/Progra~1/WinZip/wzzip.exe -s" & Me.usISACFtpPwd & " " &
Me.usFTPDest & Me.usISACFilename & " " & wkFile
OK = Shell(wkTemp, vbMinimizedNoFocus)
wkSrc = "ftp://" & Me.usISACFtpUser & ":" & Me.usISACFtpPwd & "@" &
Me.usISACFtpIP
wkCmd = "SEND " & Me.usFTPDest & Me.usISACFilename & " " &
Me.usISACFilename
Me.FT.Execute wkSrc, wkCmd
While (Me.FT.StillExecuting = True)
DoEvents
Wend
Me.FT.Execute , "CLOSE"
OK = MsgBox("MAP Billing File Successfully Posted to ISAC", vbOKOnly, "MAP
File Send")
ISACFileSendExit:
Exit Sub
ISACFileSendErr:
If (Err = 53) Then
Resume Next
Else
MsgBox "Error in ISACFileSend: " & Err & ": " & Err.Description
Resume ISACFileSendExit
End If
End Sub
</compiled code>
BTW: Be sure to register your winzip. First shareware package I ever bought
and still the best.