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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help on Corruption Deteced!

Status
Not open for further replies.

ehoh

Programmer
Dec 2, 2002
11
MY
I got runtime error message DBFNTX/1210 Corruption Deteced prompt out when my customer run the program. The program has been use for 1 years+ and now I'm checking on it and wonder the cause of the problem. I have delete index file and reindex again but still donot help.

Below are the source code and the line that marked with ***** is where the error occurred:-

FUNCTION Update_BAR( cDataPath, cSourceFile, cTargetFile, cNtx1, cNtx2, dStrDate )
LOCAL aStruct := {}
LOCAL cBarCode := ""
Local cSKN := ""
Local cMsg := "Updating HQBAR in progress."
LOCAL cImportFile := cSourceFile + "."
LOCAL nRecNo := 0
Local nTotRecs := 0

MsgRun( cMsg, "Updating Database" )
If File( cImportFile )
cTargetFile := cDataPath + "\" + cTargetFile
cNtx1 := cDataPath + "\" + cNtx1
cNtx2 := cDataPath + "\" + cNtx2
AADD( aStruct, { "Indicator", "C", 1, 0 } )
AADD( aStruct, { "Barcode", "C", 20, 0 } )
AADD( aStruct, { "Skn", "C", 15, 0 } )
DBCREATE( cSourceFile, aStruct )
NetUse( cSourceFile, .T., 5, "Source" )
APPEND FROM ( cImportFile ) SDF
NetUse( cTargetFile, .T., 5, "Target" )

Set Index to ( cNtx2 ), ( cNtx1 )
nTotRecs := Target->( LastRec() )
SELECT Source
If Source->( LastRec() ) >= 1
GO TOP
DO WHILE Source->( !EOF() )
nRecNo := Source->( RECNO() )
cSKN := Source->Skn
SELECT Target
***** IF Target->( DBSEEK( cSKN ) )
If Source->Indicator # "D"
Source->Indicator := "C"
Endif
ELSE
If Source->Indicator # "D"
APPEND BLANK
Source->Indicator := "A"
Endif
ENDIF
SELECT Target
Target->Indicator := Source->Indicator
Target->SKN := Source->SKN
Target->Barcode := Source->Barcode

SELECT Source
GOTO nRecNo
Source->( DBSKIP() )
ENDDO
Endif
Source->( DBCLOSEAREA() )
SELECT Target
SaveLog( "Download - Updated " + AllTrim( Str( Target->( LastRec() )-nTotRecs ) ) + " records (HQBAR).", "AS/400", .T., dStrDate )
Target->( DBCLOSEAREA() )
Endif
RETURN NIL



Please advice on what should i do next.

Thanks a lot.
 
If you're using clipper 5.2e or 5.3b start using de dbfcdx index drivers.
Much more stable and much less corruption of indexes.

Rob.
 
Your data might be corrupted.

What happens sometimes, you might have some eof() in your table. or the you might have some internal data damage!

If you have a tool such as dSalvage it will check the integrity of the file and scan for any unwanted eof(), any data damage or header damage.

Very good tool!
do a search on the Net for a dbf tools or dSalvage!

Ali Koumaiha
TeknoSoft Inc
Farmington Hills, Michigan
 
This data corruption described by TeknoSDS is known to be inclined by the DBFNTX driver. It also was in older versions of Clipper, where it appeared on much smaller databases, and so was experienced much more often. Please take on the DBFCDX driver as advised, and your database troubles wil not return. First repair your data though...

HTH
TonHu
 
Try the following:
after creating the .exe use something like
OPTEDIT %1.EXE -EXTRAMIN %2
where %1 is the raw-filename of your exe
and %2 is a numeric constant
(I use 0x8000 for 'bigger' dbf.files, 0x2000 elsewhere)
This seems to 'help' your .exe in handling index-files,
especially when your recreate them)
 
Dear HRStork,

Can you explain in more details?

Is that you mean after i create my exe, i have to type this below line in DOS prompt?

OPTEDIT %1.EXE -EXTRAMIN %2

for example my application name is ABC

is the below correct?

OPTEDIT ABC.EXE -EXTRAMIN 0x8000 ( if i got bigger DBF file)

the above command can only run once with the numeric constant right?

i try to run this at dos prompt but it give me bad command or file name? do i need to install/download anything?
 
OptEdit is in one of the updates for Cl 5.3 I think, but can also be in Cl 5.2e, can't check now :-(

HTH
TonHu
 
How do I get the dbfcdx index drivers.

Will they work with Clipper 5.2d?

Also will they work with Advantage Database Server?

 
fbizzell,

I'd suggest you upgrade to Clipper 5.2e as your first course of action....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top