APPEND FROM ... SDF

APPEND FROM ... SDF

Postby E. Bartzokas » Fri Mar 10, 2006 9: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
Code: Select all  Expand view
   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  Expand view
   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  Expand view
   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
E. Bartzokas
 
Posts: 114
Joined: Tue Feb 14, 2006 8:13 am
Location: Corinth, Greece

Re: APPEND FROM ... SDF

Postby Enrico Maria Giordano » Fri Mar 10, 2006 10:09 am

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

Code: Select all  Expand view
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
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: APPEND FROM ... SDF

Postby E. Bartzokas » Fri Mar 10, 2006 2: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

Code: Select all  Expand view
#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
E. Bartzokas
 
Posts: 114
Joined: Tue Feb 14, 2006 8:13 am
Location: Corinth, Greece

Re: APPEND FROM ... SDF

Postby Enrico Maria Giordano » Fri Mar 10, 2006 3:07 pm

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

Thank you.

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

Re: APPEND FROM ... SDF

Postby Richard Chidiak » Fri Mar 10, 2006 4: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

Code: Select all  Expand view
#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
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Postby Antonio Linares » Fri Mar 10, 2006 6: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42075
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 82 guests