Login  
Search All Forums
Dart Home | PowerTCP Zip Compression for Active | Custom Development Reply | PowerTCP Zip Compression for ActiveX Topics | Forums   
AuthorForum: PowerTCP Zip Compression for ActiveX
Topic: Access 2000
User312

From: Andover, United Kingdom
Posts: 41
Member Since: 10/13/00
posted June 21, 2002 7:37 AM

Hi,

I'm using the Zip tool in Access 2000.

All was working well, when I made a reference to the tool: -

Private Sub ZipFiles(strFilePath As String)
  '* Purpose :  Zip files in Temp directory.
  '* Accepts :  strFilePath Temp Path.

  Dim drtZip As New Zip
  
  drtZip.ProgressSize = 512
  drtZip.FileStore.Add strFilePath & "*.*", False, False
  drtZip.FileStore.Zip strFilePath & "C:\Data.zip"
  
End Sub

I wanted to show the progress, but wasn't sure how with just code so I added the tool to the form but now the above dosen't work, why, where have I gone wrong?

Regards
Jon Belanger



From: Rome, NY USA
Posts: 310
Member Since: 06/10/02
posted June 21, 2002 8:50 AM

Hi,

Private Sub ZipFiles(strFilePath As String)
 '* Purpose : Zip files in Temp directory.
 '* Accepts : strFilePath Temp Path.
 
  Dim drtZip As Zip
  Set drtZip = New Zip
 
  drtZip.ProgressSize = 512
  drtZip.FileStore.Add strFilePath & "\" & "*.*", False, False
  drtZip.FileStore.Zip "C:\Data.zip"
 
End Sub

Remove the component from your project, and remove it from the components list, and just keep it in the reference list. I got this to work on my machine. I'm not sure what you were trying to do with the strFilePath & "C:\Data.zip", but that turns out as a bad path name. Hope that helps.

J. Belanger
User312

From: Andover, United Kingdom
Posts: 41
Member Since: 10/13/00
posted June 21, 2002 8:55 AM

Many Thanks.

Once done, how do I show the progress once the component has been removed, as it won't be in the General Procedure drop down box?

Regards
Jon Belanger



From: Rome, NY USA
Posts: 310
Member Since: 06/10/02
posted June 21, 2002 9:37 AM

Move the

  dim drtZip as Zip

to the global level in the form, and change the command to

  Dim WithEvents drtZip as Zip

  The drtZip object should show up as an object along with the form and whatever other controls you are using and you can access the event handlers. In this case it will show up as drtZip.

-----------code example---------

Dim WithEvents drtZip As Zip

Private Sub ZipFiles(strFilePath As String)
 '* Purpose : Zip files in Temp directory.
 '* Accepts : strFilePath Temp Path.
 
 Set drtZip = New Zip
 
 drtZip.ProgressSize = 512
 drtZip.FileStore.Add strFilePath & "\" & "*.*", False, False
 drtZip.FileStore.Zip "C:\Data.zip"
 
End Sub

  Also, just to clarify, you can add the component control to the form and do this at the same time, but they will be two seperate instances.

J. Belanger
Reply | PowerTCP Zip Compression for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX