DBZAP() Corrupted
-
- Posts: 32
- Joined: Fri Jan 20, 2012 9:24 am
DBZAP() Corrupted
I am intermittently getting a "Internal data structures corrupted" (IDSC) on a THEDBF->(DBZAP()) command. The .dbf is a temporary file created by the program with a .NTX and use exclusively. The code will execute the DBZAP several times before it throws and IDSC error. It happens on different .dbfs and different locations in the program.
Doug
Doug
Re: DBZAP() Corrupted
Hi, Doug.
DbZap() is not corrupted. If you face an IDSC on DbZap(), you may have forgotten to check if the table really was opened exclusively. Just put an IF NetErr() behind the USE/DbUseArea(). It also may be an Antivirus program interfering with your app. Exclude your program and data path from the Antivirus software.
DbZap() is not corrupted. If you face an IDSC on DbZap(), you may have forgotten to check if the table really was opened exclusively. Just put an IF NetErr() behind the USE/DbUseArea(). It also may be an Antivirus program interfering with your app. Exclude your program and data path from the Antivirus software.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
-
- Posts: 32
- Joined: Fri Jan 20, 2012 9:24 am
Re: DBZAP() Corrupted
Thanks Tom,
These are temporary files I know are only opened exclusively. The DBZAP() executed without error several times before on these files before the IDSC error. I will check into the Virus Protection as a possible culprit!
Doug
These are temporary files I know are only opened exclusively. The DBZAP() executed without error several times before on these files before the IDSC error. I will check into the Virus Protection as a possible culprit!
Doug
Re: DBZAP() Corrupted
hi,
are these Files "local" or on "Server" ?
what OS() ?
have DBF used before ZAP ?
greetings by OHR
Jimmy
are these Files "local" or on "Server" ?
what OS() ?
have DBF used before ZAP ?
greetings by OHR
Jimmy
greetings by OHR
Jimmy
Jimmy
Re: DBZAP() Corrupted
I have heard of this problem over the years and I believe that one solution is to close and reopen the file after getting zapped.
In one app I just wrote a wrapper for dbZap().
In one app I just wrote a wrapper for dbZap().
Code: Select all
FUNCTION My_dbZap()
LOCAL cAlias, cDBF, cIndex
cDBF := DC_TableName()
cIndex := DC_IndexName()
cAlias := Alias()
dbZap()
dbCloseArea()
USE (cDBF) EXCLUSIVE VIA (cAlias)
IF !Empty(cIndex)
SET INDEX TO (cIndex)
ENDIF
RETURN nil
The eXpress train is coming - and it has more cars.
-
- Posts: 32
- Joined: Fri Jan 20, 2012 9:24 am
Re: DBZAP() Corrupted
Jimmy,
I tried putting the files on both places, Local hard drive and on the Windows server. Same intermittent error. The OS was Windows XP. The files had been in exclusive use and Zap'ed several times before the error.
Rodger,
I like your solution and had already figured out that closing and recreating was the solution. I'll give your function a try.
Thanks to all,
Doug
I tried putting the files on both places, Local hard drive and on the Windows server. Same intermittent error. The OS was Windows XP. The files had been in exclusive use and Zap'ed several times before the error.
Rodger,
I like your solution and had already figured out that closing and recreating was the solution. I'll give your function a try.
Thanks to all,
Doug
-
- Posts: 32
- Joined: Fri Jan 20, 2012 9:24 am
Re: DBZAP() Corrupted
Roger,
I changed:
USE (cDBF) EXCLUSIVE VIA (cAlias)
TO:
USE (cDBF) EXCLUSIVE ALIAS (cAlias)
Which worked, You were just testing me weren't you?
After second thoughts, to be safe, I changed it to
IF ".CDX" $ cIndex
USE (cDBF) EXCLUSIVE ALIAS (cAlias) VIA "DBFCDX"
ELSE
USE (cDBF) EXCLUSIVE ALIAS (cAlias) VIA "DBFNTX"
ENDIF
Thanks,
Doug
I changed:
USE (cDBF) EXCLUSIVE VIA (cAlias)
TO:
USE (cDBF) EXCLUSIVE ALIAS (cAlias)
Which worked, You were just testing me weren't you?
After second thoughts, to be safe, I changed it to
IF ".CDX" $ cIndex
USE (cDBF) EXCLUSIVE ALIAS (cAlias) VIA "DBFCDX"
ELSE
USE (cDBF) EXCLUSIVE ALIAS (cAlias) VIA "DBFNTX"
ENDIF
Thanks,
Doug
-
- Posts: 32
- Joined: Fri Jan 20, 2012 9:24 am
Re: DBZAP() Corrupted
Roger,
The close and reopen function stopped the stopped the IDSC errors for DBZAP()
Thanks,
Doug
The close and reopen function stopped the stopped the IDSC errors for DBZAP()
Thanks,
Doug
-
- Posts: 32
- Joined: Fri Jan 20, 2012 9:24 am
Re: DBZAP() Corrupted
I was premature in thinking the problem was fixed. It went from happening frequently to happening every now and then. It looks like I will rewrite the code to eliminate the Zaps!
Doug
Doug
Re: DBZAP() Corrupted
Doug -
I was wrong with "DbZap() is not corrupted". I just checked the error reports my support received during 2007 to 2010. There were lots of IDSCs in there assigned to DbZap(). But I removed all this - I a) stopped using temporary files wherever possible and replaced them using arrays (much faster anyway) and I b) created temp files from scratch where desperately needed. There is not a single DbZap() in my code anymore.
I was wrong with "DbZap() is not corrupted". I just checked the error reports my support received during 2007 to 2010. There were lots of IDSCs in there assigned to DbZap(). But I removed all this - I a) stopped using temporary files wherever possible and replaced them using arrays (much faster anyway) and I b) created temp files from scratch where desperately needed. There is not a single DbZap() in my code anymore.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."