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: don't get an error
User127

From: Venray, Netherlands
Posts: 30
Member Since: 04/10/02
posted July 19, 2002 10:55 AM

Have the following code in powerbuilder 6.5 and try to backup a sybase database

---------------------------------------
// (1) first try
BackupFiles = DirDataBase + 'FARM.KEY' + "," + DirDatabase + 'FARM05.LOG' + ',' + DirDataBase + 'FARM05.DB'

// (2) second try
BackupFiles = DirDataBase + 'FARM05.DB'

SpanSet = CREATE OLEObject
SpanSet.ConnectToNewObject("Dart.SpanSettings")

IF upper(left(DirBackup,3)) = 'A:\' OR upper(Left(DirBackup,3)) = 'B:\' THEN
SpanSet.RemovableDisk = TRUE
SpanSet.disksize = 1
ELSE
SpanSet.RemovableDisk = FALSE
SpanSet.disksize = 0
END IF

ole_zip.object.FileStore.Add(BackupFiles, TRUE, FALSE, "", 0)
IF nError > 0 THEN ErrorMessage

ole_zip.object.FileStore.Zip(DirBackup + NaamBackup, SpanSet)
IF nError > 0 THEN ErrorMessage
----------------------------------------------

If the database is used by the program I don't get aan error using (1). Using (2) I get error message 12028. If the database is not in use it works OK. Why do I not get aan error if I try to backup multiple files. Backing up (2) one file I expected to get the message read only instead of 12028 (file not found).
Jon Belanger



From: Rome, NY USA
Posts: 310
Member Since: 06/10/02
posted July 23, 2002 11:35 AM

Try using the warning object that is exposed in the Zip tool The PowerBuilder Unzipper sample gives an example of how to use this object. You will get a warning error, then you can access the WarningText in the FileStore.Item(x).WarningText property. Hope that helps.
User127

From: Venray, Netherlands
Posts: 30
Member Since: 04/10/02
posted July 24, 2002 6:04 AM

Nop, no warnings. Is nError zero when a warning occurs? I thought the value was 13501. So, the function ErrorMessage should show this number.
Tried searching the database with the files search example. If it is in use, no database is found. If I close the database it is found.
Jon Belanger



From: Rome, NY USA
Posts: 310
Member Since: 06/10/02
posted July 26, 2002 9:32 AM

To recreate your situation as close as I could I created an Access DB and tried to add it to the file store when it was opened using the VB Zip Manager sample. I was able to get the correct error, this was with multiple files and one file. The internal workings are the same anyway when trying to add more than one file, it just adds one file multiple times. So when you hit a file with a problem it will throw an error on that file and discontinue. Are you able to get the correct error when using the Zip PB sample to add your database files to an archive? Thanks.
User127

From: Venray, Netherlands
Posts: 30
Member Since: 04/10/02
posted August 1, 2002 3:36 AM

Using the ZIP pb example the database is not found when it is open. Tried the following:

First try:
 - Closed the database
 - Added the files
 - Opened the database
 - Started to ZIP
Yes, there are warnings

Second try:
 - Did NOT close the database
 - Added the files
 - Started to ZIP
NO, there are no warnings, filecount = 1 instead of 3

So, I checked the filecount after the zip. But when starting the zip 3 times filecount = 3 instead of 1. Probabluy because I added 3 times 3 files and only 1 file is backuped.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted August 5, 2002 3:29 PM

Jon asked me to look into this since I know a little more about PB. That said, I think we need to start from scratch because I get more and more confused with each topic I read in this thread. So, here is what I would like you to:

1) Which product are you using? Zip or Ziplite?
2) Tell me the EXACT name of the sample that you are using
3) Tell me EXACTLY what to do with the sample to make the error occur / not occur

Thanks.
User127

From: Venray, Netherlands
Posts: 30
Member Since: 04/10/02
posted August 6, 2002 4:30 AM

I use the ZIP product
I use the filesearch sample program

Our program makes use of a Sybase Adaptive server anywhere database 7.0.
If the database is opened (with the sybase program dbeng7.exe - database engine 7 -) the filesearch program will not find the database.
If we close the database the filesearch program will find it and the zip works ok.

We use the same routine on a microsoft access database. Here it works always ok.

Eric
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted August 6, 2002 9:19 AM

So are you saying that you start the sample, choose the path you want, click search and you get no warnings? If that's the case I'll need a little help duplicating this because it seems to work for me.

As a test I searched my profile directory for *.dat, which gave me about 5 warnings for in use files.

Please note that I changed the way the warnings are displayed though. On my machine the text file was getting deleted before it could be displayed. I changed the last lines of ShowWarnings() to this:

Stream.FileMode = createUnique
Stream.Filename = StartUpPath + "\Warnings.txt"
Run("Notepad.exe " + Stream.Filename, Normal!)
Reply | PowerTCP Zip Compression for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX