FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Index problem
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM

Index problem

Posted: Fri Jun 06, 2014 08:05 AM

I have a customer who often gets this error :

hb_cdxPageSeekKey: wrong parent key.hb_cdxPageSeekKey: wrong parent key.

What causes this error? And how can it be prefended?

Thanks a lot in advance.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: Index problem

Posted: Fri Jun 06, 2014 09:33 AM

Michel,

I would say that it is a corrupted index.

Tell your customer never to turn off the computer suddenly. Does he has power supply problems ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM

Re: Index problem

Posted: Fri Jun 06, 2014 11:02 AM

Antonio,

The error occurs now and then. But if the application is started again, everything is ok. But after a while, the problem occurs again.
It has nothing to do with shutting down the PC suddenly.

Very strange.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: Index problem

Posted: Fri Jun 06, 2014 01:48 PM

Michel,

Then it points to memory corruption and it could be a xharbour problem (as FWH does not manage the RDD internals at all).

If you rebuild your app using Harbour then we could know it for sure.

FYI, Colin from Australia (in these forums) has successfully migrated from xHarbour (.com) to Harbour in three days and now he is using Visual Studio also (he finished his migration yesterday, as I have been assisting him) :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM

Re: Index problem

Posted: Fri Jun 06, 2014 03:00 PM
hello, I do so and I have no problems.

Code (fw): Select all Collapse
FUNCTION ReIndPack( lPack, lIndCep, oMostraIndCep, olPack, oMeter1, ;
                           oMeter2, oMeter3 )

    LOCAL Del_Indice

    DEL_INDICE := DIRECTORY( "*.CDX" )

    FOR I = 1 TO LEN( Del_Indice )
       FERASE( DEL_INDICE[I][1] )
    NEXT I

    IF NetUse( "AGENDGRP", .F. )

        IF lPack = .T.

            MsgRun( "Borrando Registros Excluidos...", ;
                    "Por Favor, Espere!"             , ;
                    { || __DbPack() } )

        ENDIF

        oMeter1:nTotal = RecCount()

        INDEX ON Field->GTE_CODIGO            TAG CODIGO TO   AGENDGRP    ;
              FOR !DELETED()                                              ;
              EVAL ( oMeter1:Set( RecNo() ), CursorWait(), SysRefresh() ) ;
              EVERY 10


        INDEX ON Field->GTE_NOMBRE             TAG NOMBRE TO   AGENDGRP   ;
              FOR !DELETED()                                              ;
              EVAL ( oMeter1:Set( RecNo() ), CursorWait(), SysRefresh() ) ;
              EVERY 10

        DbCloseAll()

    ENDIF

    ...

RETURN NIL


Regards,
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: Index problem

Posted: Fri Jun 06, 2014 05:30 PM

João,

Do you use Harbour or xHarbour ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM

Re: Index problem

Posted: Fri Jun 06, 2014 05:54 PM

xHarbour, master.

xHarbour 1.2.3 Intl. (SimpLex) (Build 20130422)
Copyright 1999-2013, http://www.xharbour.org http://www.harbour-project.org/

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: Index problem

Posted: Fri Jun 06, 2014 07:02 PM

It could be also interesting if other xHarbour users report here if they have ever seen that kind of error also.

To me its look like memory corruption, so we should consider all possibilities where such corruption could come from.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM

Re: Index problem

Posted: Sat Jun 07, 2014 09:46 AM

Antonio,

I want to give it a try to transfer my apps from xHarbour Builder to Harbour but I have never used Harbour before. I have always been using xHarbour Builder, which is quite easy to use.

I found a lot of BAT-files in the samples folder. Which one do I have to use?

I have more than 30 PRG-files, a few RC-files and some extra libs. How do I put them into one of the BAT-files?

I can send you a XBP-file from xHarbour Builder. Can you change into a BUILD(H).BAT?

Thank you so much for any help.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: Index problem

Posted: Sat Jun 07, 2014 12:27 PM

Michel,

Do you want to use Borland or Microsoft ?

Just send me your XBP file and I will build a makefile for you, and just calling a little bat file that I will provide you,
you will have everything built and running so easily :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM

Re: Index problem

Posted: Sat Jun 07, 2014 02:00 PM

Antonio,

I just send you my XBP-file by e-mail.

Thanks a lot.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: Index problem

Posted: Sat Jun 07, 2014 02:27 PM

Michel,

Please better do:

dir *.prg > files.txt

and email files.txt, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: Index problem

Posted: Sat Jun 07, 2014 03:32 PM

Michel,

Already sent to your email, I wait for your feedback.

If you don't mind it, I would like to post it here to help others (unless you don't want it, which I would fully respect)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM

Re: Index problem

Posted: Sat Jun 07, 2014 06:49 PM

Antonio,

No problem. You can post everything here of course. Glad to help others if necessary.

Thanks.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: Index problem

Posted: Sat Jun 07, 2014 08:08 PM
Michel,

Thanks. Here I copy it in case someone else want to use it:

go.bat
Code (fw): Select all Collapse
if not exist obj md obj
c:\bcc582\bin\make -ftest.mak


test.mak
Code (fw): Select all Collapse
#Borland make for Michel, (c) FiveTech Software 2014

HBDIR=c:\harbour
BCDIR=c:\bcc582
FWDIR=c:\fwh

#change these paths as needed
.path.OBJ = .\obj
.path.PRG = .\
.path.CH  = $(FWDIR)\include;$(HBDIR)\include
.path.C   = .\
.path.rc  = .\

#important: Use Uppercase for filenames extensions, in the next two rules!

PRG =        \
.\BEHAGEN1.PRG \
.\BEHAGEN2.PRG \
.\BEHBOEK1.PRG \
.\BEHBOEK2.PRG \
.\BEHDOSS1.PRG \
.\BEHDOSS2.PRG \
.\BEHINTRX.PRG \
.\BEHPAAND.PRG \
.\BEHPARAM.PRG \
.\BEHPRARC.PRG \
.\BEHSOOR1.PRG \
.\BEHSOOR2.PRG \
.\BEHUSER.PRG  \
.\DOCWP1.PRG   \
.\DOCWP2.PRG   \
.\FGEGTL1.PRG  \
.\GEGTL2.PRG   \
.\JUDA.PRG     \
.\MAKEIND.PRG  \
.\RAPAGPRE.PRG \
.\RAPDOSBH.PRG \
.\STJUDA.PRG   \
.\TINATIVO.PRG \
.\Z-ERROR1.PRG \
.\Z-PRINT.PRG  \
.\Z-RPREV.PRG  \
.\Z-TGET.PRG   \
.\Z-WBROWS.PRG

OBJ = $(PRGS:.PRG=.OBJ)
OBJS = $(OBJ:.\=.\obj\)

PROJECT  : JUDA.EXE

JUDA.EXE : $(OBJS) JUDA.RES
   echo off
   echo $(BCDIR)\lib\c0w32.obj + > b32.bc
   echo $(OBJS), + >> b32.bc
   echo juda.exe, + >> b32.bc
   echo juda.map, + >> b32.bc
   echo $(FWDIR)\lib\FiveH.lib $(FWDIR)\lib\FiveHC.lib + >> b32.bc
   echo $(HBDIR)\lib\hbrtl.lib + >> b32.bc
   echo $(HBDIR)\lib\hbvm.lib + >> b32.bc
   echo $(HBDIR)\lib\gtgui.lib + >> b32.bc
   echo $(HBDIR)\lib\hblang.lib + >> b32.bc
   echo $(HBDIR)\lib\hbmacro.lib + >> b32.bc
   echo $(HBDIR)\lib\hbrdd.lib + >> b32.bc
   echo $(HBDIR)\lib\rddntx.lib + >> b32.bc
   echo $(HBDIR)\lib\rddcdx.lib + >> b32.bc
   echo $(HBDIR)\lib\rddfpt.lib + >> b32.bc
   echo $(HBDIR)\lib\hbsix.lib + >> b32.bc
   echo $(HBDIR)\lib\hbdebug.lib + >> b32.bc
   echo $(HBDIR)\lib\hbcommon.lib + >> b32.bc
   echo $(HBDIR)\lib\hbpp.lib + >> b32.bc
   echo $(HBDIR)\lib\hbwin.lib + >> b32.bc
   echo $(HBDIR)\lib\hbcpage.lib + >> b32.bc
   echo $(HBDIR)\lib\hbct.lib + >> b32.bc
   echo $(HBDIR)\lib\png.lib + >> b32.bc
   echo $(HBDIR)\lib\hbcplr.lib + >> b32.bc
   echo $(HBDIR)\lib\xhb.lib + >> b32.bc
   echo $(HBDIR)\lib\hbzlib.lib + >> b32.bc

   rem Uncomment these two lines to use Advantage RDD
   rem echo $(HBDIR)\lib\rddads.lib + >> b32.bc
   rem echo $(HBDIR)\lib\Ace32.lib + >> b32.bc

   echo $(BCDIR)\lib\cw32.lib + >> b32.bc
   echo $(BCDIR)\lib\import32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\odbc32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\nddeapi.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\iphlpapi.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\msimg32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\rasapi32.lib, >> b32.bc

   IF EXIST juda.res echo juda.res >> b32.bc
   $(BCDIR)\bin\ilink32 -Gn -aa -Tpe -s @b32.bc
   del b32.bc

.PRG.OBJ:
  $(HBDIR)\bin\harbour $< /L /N /W /V /Oobj\ /I$(FWDIR)\include;$(HBDIR)\include
  $(BCDIR)\bin\bcc32 -c -tWM -I$(HBDIR)\include -oobj\$& obj\$&.c

.C.OBJ:
  echo -c -tWM -D__HARBOUR__ -DHB_API_MACROS > tmp
  echo -I$(HBDIR)\include;$(FWDIR)\include >> tmp
  $(BCDIR)\bin\bcc32 -oobj\$& @tmp $&.c
  del tmp

juda.res : juda.rc
  $(BCDIR)\bin\brc32.exe -r juda.rc
regards, saludos

Antonio Linares
www.fivetechsoft.com