Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PzZip/Shell problems

Status
Not open for further replies.

dodgyone

Technical User
Jan 26, 2001
431
GB
Has someone any ideas?

I am using shell to call PKZip.exe but it doesn't seem to be able to see my location paths... my code =

'creates the location string to create zip file into
LocationZip = frmMain.txtFolder(0).Text & "\" & strTodaysDate & ".zip"
'Takes the values from the location text boxes and joins the
'strings to the two mdb file names...
LocationXtrain = frmMain.txtFolder(0).Text & "\Xtrain.mdb"
LocationUser = frmMain.txtFolder(0).Text & "\User.mdb"

'Sets the properties to zip up the files...
pkz = "C:\Windows\Command\pkzip.exe" 'where the exec is
n = "LocationZip" 'What to call zip and destination
o = "LocationXtrain LocationUser "
CommandLine = pkz & " " & n & " " & o 'Joins these together
'ShellAndWait is a .bas file to wait for the procedure to end
ShellAndWait (CommandLine)
MsgBox "Finished..."

I'm just banging my head against a brick wall... it just can't see the mdb files to compress ;o(
 
Looks like the paths are not being picked up. Should it not read

n = LocationZip
o = LocationXtrain & " " & LocationsUser

Richard
 
I've tried that but it still cannot see the paths... I can't work out why ;o(

Thanks for the thought though ;o)
 
OK,

2 more thoughts then,

1. The connection to one of the databases is open and
therefore locked so Windows will not allow you to zip
the mdb. Try closing the connection - difficult if
multi-user.

2. Debug the call to pkzip by doing the following

Change you pkzip.exe to pkzip.bat and create a batch file
called pkzip.bat in your c:\windows\command folder.
In this batch file put in the following

@ECHO OFF
echo %1
echo %2
echo %3
pause

Run the routine again and this should show you at least the
parameters that are being passed to pkzip.

Richard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top