FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour APPEND FROM ... SDF
Posts: 114
Joined: Tue Feb 14, 2006 08:13 AM
APPEND FROM ... SDF
Posted: Fri Mar 10, 2006 09:57 AM
I don't really know if this an XHB error or FWH error.

It worked before Feb 2006 (XHB and FWH), but now it crashes
   Error description: Error DBFCDX/1023  Exclusive required

   Called from:  => __DBPACK(0)
   Called from: dbsdf.prg => __DBSDF(241)
   Called from: IMP_CLK.PRG => IMPORT_HRS(343)

   Line 343 contained this below, but never had problems before 10/mar/2006

   append from (xClPath+"_MAST.TXT") SDF


My search for DBSDF.PRG in FWH\SOURCE failed of course ...

The original code was as this:

   Create (xClPath+"_MIMP.DBF") FROM (xClPath+"_MAST.STR")
   newinfile := Select()
   SELECT (newinfile)
   append from (xClPath+"_MAST.TXT") SDF
   (newinfile)->(DBCLOSEAREA())


My solution was to add this line:
   Create (xClPath+"_MIMP.DBF") FROM (xClPath+"_MAST.STR")
   newinfile := Select()
   SELECT (newinfile)
   USE (xClPath+"_MIMP.DBF") alias QQQQ EXCLUSIVE  //  added
   append from (xClPath+"_MAST.TXT") SDF
   (newinfile)->(DBCLOSEAREA())


Any advise ?

Regards, saludos
Evans
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: APPEND FROM ... SDF
Posted: Fri Mar 10, 2006 10:09 AM
The following sample works fine. Can you modify it to reproduce the problem?

FUNCTION MAIN()

    USE TEST SHARED

    COPY TO TMPTEST FOR .F.

    USE TMPTEST SHARED

    APPEND FROM TEST

    GO TOP

    BROWSE()

    CLOSE

    FERASE( "TMPTEST.DBF" )

    RETURN NIL


EMG
Posts: 114
Joined: Tue Feb 14, 2006 08:13 AM
Re: APPEND FROM ... SDF
Posted: Fri Mar 10, 2006 02:53 PM
Sorry for the long example.
This example you can save in \FWH\SAMPLES and run it.
I use XHB Professional ver. 4.01 Jan 24 2006 09:15:21

APPEND FROM ... DATABASE works fine.
APPEND FROM ... SDF does not work (see the error below)

Thanks for the interest
regards
Evans

#INCLUDE 'FIVEWIN.CH'

Function MAIN()

   // This example was ran in FWH\SAMPLES
   
  USE CUSTOMER SHARED

    COPY TO TMPTEST.TXT FOR RTrim(first) == 'Homer' SDF  //  SDF correctly outputs 5 records
    COPY TO TMPTEST.DBF FOR RTrim(first) == 'Andy'       //  DBF correctly outputs 2 records
    
    USE TMPTEST SHARED
    BROWSE()                     // Contains 2 records

    APPEND FROM TMPTEST.TXT SDF  // SDF crashes here !!!
    
    /*
      Error description: Error DBFNTX/1023  Exclusive required
      Stack Calls
      ===========
      Called from:  => __DBPACK(0)
      Called from: dbsdf.prg => __DBSDF(241)
      Called from: APPEND_FROM.PRG => MAIN(15)
    */

    GO TOP
    BROWSE()
    CLOSE
    FERASE( "TMPTEST.TXT" )    // .TXT !!!

    RETURN NIL
    


// Suggested solution by Antonio - Must be added to a PRG

#pragma BEGINDUMP 

#include "hbapi.h" 
#include "hbapiitm.h" 

PHB_SYMB hb_dynsymSymbol( PHB_DYNS pDynSym ) 
{ 
return pDynSym->pSymbol; 
} 

#pragma ENDDUMP
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: APPEND FROM ... SDF
Posted: Fri Mar 10, 2006 03:07 PM

Confirmed. Already reported in the xHarbour developer's mailing-list.

Thank you.

EMG

Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Re: APPEND FROM ... SDF
Posted: Fri Mar 10, 2006 04:11 PM
E. Bartzokas wrote:Sorry for the long example.
This example you can save in \FWH\SAMPLES and run it.
I use XHB Professional ver. 4.01 Jan 24 2006 09:15:21

APPEND FROM ... DATABASE works fine.
APPEND FROM ... SDF does not work (see the error below)

Thanks for the interest
regards
Evans

#INCLUDE 'FIVEWIN.CH'

Function MAIN()

   // This example was ran in FWH\SAMPLES
   
  USE CUSTOMER SHARED

    COPY TO TMPTEST.TXT FOR RTrim(first) == 'Homer' SDF  //  SDF correctly outputs 5 records
    COPY TO TMPTEST.DBF FOR RTrim(first) == 'Andy'       //  DBF correctly outputs 2 records
    
    USE TMPTEST SHARED
    BROWSE()                     // Contains 2 records

    APPEND FROM TMPTEST.TXT SDF  // SDF crashes here !!!
    
    /*
      Error description: Error DBFNTX/1023  Exclusive required
      Stack Calls
      ===========
      Called from:  => __DBPACK(0)
      Called from: dbsdf.prg => __DBSDF(241)
      Called from: APPEND_FROM.PRG => MAIN(15)
    */

    GO TOP
    BROWSE()
    CLOSE
    FERASE( "TMPTEST.TXT" )    // .TXT !!!

    RETURN NIL
    


// Suggested solution by Antonio - Must be added to a PRG

#pragma BEGINDUMP 

#include "hbapi.h" 
#include "hbapiitm.h" 

PHB_SYMB hb_dynsymSymbol( PHB_DYNS pDynSym ) 
{ 
return pDynSym->pSymbol; 
} 

#pragma ENDDUMP


I have reported this bug over a month ago in the xharbour ng with a sample, but no one replied !!!!! :-)

A fix will be opening the file "exclusive"
:-)
Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
APPEND FROM ... SDF
Posted: Fri Mar 10, 2006 06:08 PM

You may directly report it to Przemek at druzus@priv.onet.pl as he is the RDDs best expert.

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion