Dear All,
I've found this error following message while build index files.
TEST.EXE caused a General Protection Fault in
module TEST.EXE at 0022:4221.
Choose close TEST.EXE will close.
After I close this error message box. The index file of last file is 0 byte and when I browse this database file the another error is below
DbUseArea() Internal error 1010
I try to find out and got some post that inform to increase stack size and set clipper //E:0 for disable EMS but it doesn't work. The error is still. How can I fix it?
Regards,
Dutch
DbUseArea() Internal error 1010 after index with error
- Detlef Hoefner
- Posts: 312
- Joined: Sat Oct 08, 2005 9:12 am
- Location: Germany
- Contact:
Index corrupt after add TSbrowse
Dear Detlef,
This is my index file procedure. I found this error has occur after I add TSbrowse.lib in my program. When I do not include Tsbrowse.ch and do not call TSbrowse the index run fine. I don't know why does it append?
Regards,
Dutch
*--------------*
Procedure IndexCheck(IndexAll)
OPENFILE('CCRIND','DX')
DX->(DbGotop())
do while !DX->(eof())
if ((!file(rtrim(DX->IND_DBF)+'.CDX').or.IndexAll) .and. !empty(DX->IND_NTX) .and. file(MEMVAR->cFoPath+rtrim(DX->IND_DBF)+'.DBF'))
cDbf := upper(rtrim(DX->IND_DBF))
OPENFILE(cDBF,,,.F.)
do while upper(rtrim(DX->IND_DBF)) == cDBF
cNtx := rtrim(DX->IND_NTX)
cExp := rtrim(DX->IND_EXP)
lAsend := iif(DX->IND_SORT='D',.F.,.T.)
if IndexAll .and. dow(date()) = 1
pack
end
MsgMeter( { | oMeter, oText, oDlg, lEnd | ;
BuildIndex( oMeter, oText, oDlg, @lEnd, cNtx, cExp, lAsend ) },;
"Indexing TAG "+cNtx,'Building index file, Please wait..' )
DX->(dbskip())
if !(upper(rtrim(DX->IND_DBF)) == cDBF)
DX->(dbskip(-1))
exit
end
end
CLOSEFILE(cDbf)
SELECT('DX')
end
DX->(dbskip())
end
CLOSEFILE('DX')
select(old_sel)
return
*----------------------------------------------*
Static Function BuildIndex( oMeter, oText, oDlg, lEnd, cNtx, cExp, lAsend )
oMeter:nTotal := Int(LastRec()/10)
if lAsend
INDEX ON &cExp TAG &cNtx ;
EVAL ( oMeter:Set( int(RecNo()/10) ), SysRefresh(), !lEnd ) ;
EVERY Int(Lastrec()/10)
else
INDEX ON &cExp TAG &cNtx ;
EVAL ( oMeter:Set( int(RecNo()/10) ), SysRefresh(), !lEnd ) ;
EVERY Int(Lastrec()/10) ;
DESCENDING
end
return nil
This is my index file procedure. I found this error has occur after I add TSbrowse.lib in my program. When I do not include Tsbrowse.ch and do not call TSbrowse the index run fine. I don't know why does it append?
Regards,
Dutch
*--------------*
Procedure IndexCheck(IndexAll)
OPENFILE('CCRIND','DX')
DX->(DbGotop())
do while !DX->(eof())
if ((!file(rtrim(DX->IND_DBF)+'.CDX').or.IndexAll) .and. !empty(DX->IND_NTX) .and. file(MEMVAR->cFoPath+rtrim(DX->IND_DBF)+'.DBF'))
cDbf := upper(rtrim(DX->IND_DBF))
OPENFILE(cDBF,,,.F.)
do while upper(rtrim(DX->IND_DBF)) == cDBF
cNtx := rtrim(DX->IND_NTX)
cExp := rtrim(DX->IND_EXP)
lAsend := iif(DX->IND_SORT='D',.F.,.T.)
if IndexAll .and. dow(date()) = 1
pack
end
MsgMeter( { | oMeter, oText, oDlg, lEnd | ;
BuildIndex( oMeter, oText, oDlg, @lEnd, cNtx, cExp, lAsend ) },;
"Indexing TAG "+cNtx,'Building index file, Please wait..' )
DX->(dbskip())
if !(upper(rtrim(DX->IND_DBF)) == cDBF)
DX->(dbskip(-1))
exit
end
end
CLOSEFILE(cDbf)
SELECT('DX')
end
DX->(dbskip())
end
CLOSEFILE('DX')
select(old_sel)
return
*----------------------------------------------*
Static Function BuildIndex( oMeter, oText, oDlg, lEnd, cNtx, cExp, lAsend )
oMeter:nTotal := Int(LastRec()/10)
if lAsend
INDEX ON &cExp TAG &cNtx ;
EVAL ( oMeter:Set( int(RecNo()/10) ), SysRefresh(), !lEnd ) ;
EVERY Int(Lastrec()/10)
else
INDEX ON &cExp TAG &cNtx ;
EVAL ( oMeter:Set( int(RecNo()/10) ), SysRefresh(), !lEnd ) ;
EVERY Int(Lastrec()/10) ;
DESCENDING
end
return nil
no trim in index expression
Dear Gale,
The index expression has no trim() function.
Thanks,
Dutch
The index expression has no trim() function.
Thanks,
Dutch
Strange behavier of index bar
Dear All,
I try to create index without MsgMeter() and the error is not occur and still link TSbrowse. I think the problem is TSbrowse+MsgMeter().
- TSbrowse + MsgMeter() is problem
- MsgMeter() is no problem
- TSbrowse is no problem
Does anyone face the problem?
Regards,
Dutch
I try to create index without MsgMeter() and the error is not occur and still link TSbrowse. I think the problem is TSbrowse+MsgMeter().
- TSbrowse + MsgMeter() is problem
- MsgMeter() is no problem
- TSbrowse is no problem
Does anyone face the problem?
Regards,
Dutch
- Detlef Hoefner
- Posts: 312
- Joined: Sat Oct 08, 2005 9:12 am
- Location: Germany
- Contact:
Hi Dutch,
i doubt that either TsBrowse or MsgMeter is the cause of your protection fault.
I made some modifications to your code.
Because i didn't have the necessary dbf files and the rest of your code i couldn't try my suggest.
The most important IMO is to avoid calling lastrec() in the index command and the call of Sysrefresh() in the ordCondSet() call.
Perhaps this might help you?
Best regards,
Detlef
i doubt that either TsBrowse or MsgMeter is the cause of your protection fault.
I made some modifications to your code.
Because i didn't have the necessary dbf files and the rest of your code i couldn't try my suggest.
The most important IMO is to avoid calling lastrec() in the index command and the call of Sysrefresh() in the ordCondSet() call.
Perhaps this might help you?
Best regards,
Detlef
Code: Select all
// ----------------------------
PROCEDURE IndexCheck( IndexAll )
// ----------------------------
OPENFILE( 'CCRIND','DX' )
DX->( DbGotop() )
do while !DX->( eof() )
if ( ( !file( rtrim( DX->IND_DBF ) + '.CDX' ) .or. IndexAll ) .and.;
!empty( DX->IND_NTX ) .and. file( MEMVAR->cFoPath + rtrim( DX->IND_DBF ) + '.DBF' ) )
cDbf := upper( rtrim( DX->IND_DBF ) )
dbUseArea( .t., "comix", cDbf, "wrk", .f., .f.)
if neterr()
alert( "File " + cDbf + " could not be opened in exclusive mode.", {} )
RETURN
endif
do while upper( rtrim( DX->IND_DBF ) ) == cDBF
cNtx := rtrim( DX->IND_NTX )
cExp := rtrim( DX->IND_EXP )
lAsend := if( DX->IND_SORT = 'D', .F., .T. )
if IndexAll .and. dow( date() ) = 1
wrk->( __dbPack() )
endif
MsgMeter( { | oMeter, oText, oDlg, lEnd | BuildIndex( oMeter, oText, oDlg, @lEnd, cNtx, cExp, lAsend ) },;
"Indexing TAG " + cNtx, 'Building index file, Please wait..' )
DX->( dbskip() )
if !( upper( rtrim( DX->IND_DBF ) ) == cDBF )
DX->( dbskip( -1 ) )
EXIT
end
end
wrk->( dbCloseArea() )
dbSelectArea( 'DX' )
end
DX->( dbskip() )
end
CLOSEFILE( 'DX' )
select( old_sel )
return
// -------------------------------------------------------------------------
STATIC PROCEDURE BuildIndex( oMeter, oText, oDlg, lEnd, cNtx, cExp, lAsend )
// -------------------------------------------------------------------------
LOCAL nEvery := int( wrk->( lastrec() ) / 10 )
oMeter:nTotal := wrk->( lastrec() )
ordCondSet( nil, nil, nil, !lEnd, { || oMeter:Set( int( wrk->( recno() / 10 ) ) ), SysRefresh() }, nEvery, nil, nil, nil, nil, !lAsend, nil, .f., .f., .f., .f. )
ordCreate( NIL, cNtx, cExp, &( "{||" + cExp + "}" ), .f. )
RETURN
I will try
Dear Detlef,
Thank you for your suggestion and I will try.
Regards,
Dutch
Thank you for your suggestion and I will try.
Regards,
Dutch