OrdCreate with Tdatabase

OrdCreate with Tdatabase

Postby Silvio.Falconi » Sat Jan 22, 2022 11:55 am

I must a procedure to create the index for many dbfs
It run ok
I save all nfo into an array aIdx

Code: Select all  Expand view  RUN


   local bCode
   local cfor := "!Deleted()"
   local bFor := "{ || " + cfor + "}"

FOR i := 1 TO LEN( ::aIdx )
        DbUseArea( .F. ,, ::cFilesPath+::aIdx[ i, 1 ],, .F. )
          FOR k := 1 TO LEN( ::aIdx[ i, 2 ] )
             bCode := "{ || " + ::aIdx[ i, 2, k, 1 ] + "}"
             OrdCondSet(cFor,bFor,,,,, RECNO(),,,, )
             OrdCreate( ::cFilesPath+::aIdx[ i, 2, k, 3 ], ::aIdx[ i, 2, k, 2 ],  ::cFilesPath+::aIdx[ i, 2, k, 1 ], &bCode )
      NEXT

      DbCloseArea()


 

then when I open a dbf with the cdx (for example with the EMAGDBU program or fwdbu) it tells me that the index file is corrupt

Code: Select all  Expand view  RUN
 Error occurred at: 22/01/2022, 12:55:39
   Error description: Error DBFCDX/1012  Corruption detected: C:\work\Prg\NewSostituzioni\2021\Data\AULE.cdx

Stack Calls
===========
   Called from:  => DBUSEAREA( 0 )
   Called from: fivedbu.prg => OPEN( 234 )
   Called from: fivedbu.prg => (b)BUILDMAINBAR( 83 )
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 693 )
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 944 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1721 )
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 1909 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3368 )
   Called from:  => WINRUN( 0 )
   Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 1043 )
   Called from: fivedbu.prg => FIVEDBU( 59 )

 



how do I fix it?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7063
Joined: Thu Oct 18, 2012 7:17 pm

Re: OrdCreate with Tdatabase

Postby Jimmy » Sat Jan 22, 2022 1:57 pm

hi Silvio,

i think 3rd. Parameter "cIndexKey" does not use PATH
Code: Select all  Expand view  RUN
OrdCreate( ::cFilesPath+::aIdx[ i, 2, k, 3 ], ;
           ::aIdx[ i, 2, k, 2 ],;
           ::cFilesPath+::aIdx[ i, 2, k, 1 ],;
           &bCode )


OrdCreate( <cIndexFile> , ;
[<cTagName>] , ;
<cIndexKey> , ;
[<bIndexKey>] , ;
[<lUnique>] , ;
[<lAdditive>] ) --> NIL
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: OrdCreate with Tdatabase

Postby Silvio.Falconi » Sat Jan 22, 2022 11:09 pm

ooppss
you're right
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7063
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 119 guests