APPEND FROM ... SDF

Post Reply
User avatar
E. Bartzokas
Posts: 114
Joined: Tue Feb 14, 2006 8:13 am
Location: Corinth, Greece

APPEND FROM ... SDF

Post by E. Bartzokas »

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

Code: Select all

   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:

Code: Select all

   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:

Code: Select all

   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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: APPEND FROM ... SDF

Post by Enrico Maria Giordano »

The following sample works fine. Can you modify it to reproduce the problem?

Code: Select all

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
User avatar
E. Bartzokas
Posts: 114
Joined: Tue Feb 14, 2006 8:13 am
Location: Corinth, Greece

Re: APPEND FROM ... SDF

Post by E. Bartzokas »

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

Code: Select all

#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 
  

 
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: APPEND FROM ... SDF

Post by Enrico Maria Giordano »

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

Thank you.

EMG
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: APPEND FROM ... SDF

Post by Richard Chidiak »

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

Code: Select all

#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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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
Post Reply