FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for CA-Clipper DbUseArea() Internal error 1010 after index with error
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
DbUseArea() Internal error 1010 after index with error
Posted: Thu Jul 27, 2006 02:36 PM

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

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
DbUseArea() Internal error 1010 after index with error
Posted: Thu Jul 27, 2006 02:49 PM

Hi Dutch,

could you please show us the piece of prg for your index creation?

Regards,
Detlef

Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Index corrupt after add TSbrowse
Posted: Thu Jul 27, 2006 03:36 PM

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

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
DbUseArea() Internal error 1010 after index with error
Posted: Thu Jul 27, 2006 03:44 PM

You do not want to index using trim(). The index has to remain a fixed length.

Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
no trim in index expression
Posted: Thu Jul 27, 2006 03:58 PM

Dear Gale,

The index expression has no trim() function.

Thanks,
Dutch

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Strange behavier of index bar
Posted: Thu Jul 27, 2006 06:47 PM

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

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
DbUseArea() Internal error 1010 after index with error
Posted: Thu Jul 27, 2006 10:08 PM
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

// ----------------------------
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
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
I will try
Posted: Fri Jul 28, 2006 02:30 AM

Dear Detlef,

Thank you for your suggestion and I will try.

Regards,
Dutch

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)

Continue the discussion