>Local lcFileList, lcItemList, lcZipFileComment, llError, lcZIPFileName >Local loZip As dzactxctrl.dzactxctrl.1 >lcFileList = "" >lcZIPFileName = "BackData.Zip" > >* instantiate a DynaZip object to zip files >Try > loZip = Createobject("dzactxctrl.dzactxctrl.1") > llError = .F. > >Catch To oErr > * could not instantiate DynaZIP library > * most probable Errno: 1733 - "Class definition <name> is not found" > loZip = .Null. > llError = .T. > * do whatever >Endtry > >If llError > Return .F. >Endif > >lcFileList = This.cDataFolder + "Delta*.DBF" >lcFileList = lcFileList + " " + This.cDataFolder + "Merter*.XML" > >* use DynaZip ActiveX >With loZip > .ActionDZ = ZIP_NOACTION && turn off > .ZipFile = Alltrim(This.cFolder + lcZIPFileName) > .EncryptCode = "testpwd" > .EncryptFlag = .T. > > * file(s) or list of items to ZIP (make sure it has full path) > .ItemList = Alltrim(lcFileList) > > .NoDirectoryNamesFlag = .T. && don't add path to ZIP files > .ActionDZ = ZIP_ADD && executes > .ActionDZ = ZIP_NOACTION && turn off > > If .ErrorCode = ZE_OK > * all's well. > Else > * error creating ZIP file > lcMessage = "Error creating ZIP file!" > * I log error here and send email to SysAdmin > Messagebox(lcMessage, MB_ICONSTOP, "ZIP Error") > Endif >Endwith >