Page 1 of 1

TD_ERASERECORD ERROR

Posted: Wed Jun 19, 2019 5:38 pm
by Silvio.Falconi
I'm using + field autoincremental


I'm using tdata/tdatabase

it appears the the TD_EraseRecord() method is unable to handle the fieldtype +

when I save a record I have this error

Code: Select all

Application
===========
   Path and name: C:\Work\Prg\Tdata\Bikini\main.Exe (32 bits)
   Size: 7,006,720 bytes
   Compiler version: Harbour 3.2.0dev (r1904111533)
   FiveWin  version: FWH 19.05
   C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
   Windows version: 6.2, Build 9200 

   Time from start: 0 hours 2 mins 32 secs 
   Error occurred at: 19-06-2019, 17:28:24
   Error description: Error DBFCDX/1020  Errore nel tipo dei dati: ELNUMERO
   Args:
     [   1] = N   0

Stack Calls
===========
   Called from:  => FIELDPUT( 0 )
   Called from: .\source\classes\DATABASE.PRG => TELEMENTI:TD_ERASERECORD( 2114 )
   Called from: .\source\classes\DATABASE.PRG => TELEMENTI:TD_APPENDBLANK( 2171 )
   Called from: .\source\classes\DATABASE.PRG => TDATABASE:APPEND( 1514 )
   Called from: Lib\tdata\TData.prg => TELEMENTI:RECAPPEND( 427 )
   Called from: Lib\tdata\TData.prg => (b)TDATA_APPEND( 235 )
   Called from: Lib\tdata\TData.prg => TELEMENTI:NETLOCK( 394 )
   Called from: Lib\tdata\TData.prg => TELEMENTI:APPEND( 235 )
   Called from: Lib\tdata\TNextID.prg => TELEMENTI:SAVE( 124 )
   Called from: Lib\tdata\TRecord.prg => TELEMENTO:SAVE( 139 )
   Called from: source\PElementi.prg => ELEDITA( 815 )

the structure of elementi.dbf

Code: Select all

  DbCreate(cDir+'El',{  { "ELNUMERO"   , "+",    2, 0 },; //NUMERO
                            { "ELORDINE"   , "N",    2, 0 },; //ORDINE
                            { "ELNOME"     , "C",   30, 0 },; //DESC
                            { "ELCOLORE"   , "C",   30, 0 },; //COLORE
                            { "ELATTIVO"   , "L",    1, 0 },; // ATTIVO
                            { "ELIMGLIB"   , "C",  120, 0 },; // LIBERO
                            { "ELIMGOCC"   , "C",  120, 0 },; // OCCUPATO
                            { "ELIMGALT"   , "C",  120, 0 },; //DISEGNO
                            { "ELLOCK"     , "L",    1, 0 }}, 'DBFCDX')

the index

Code: Select all

 

    INDEX ON ELNUMERO TAG EL001 EVAL (oProgress:SetPos(nProgress++), Sysrefresh()) EVERY 1  FOR !Deleted()
     INDEX ON ELORDINE TAG EL002 EVAL (oProgress:SetPos(nProgress++), Sysrefresh()) EVERY 1   FOR !Deleted()
      INDEX ON ELNOME TAG EL003 EVAL (oProgress:SetPos(nProgress++), Sysrefresh()) EVERY 1   FOR !Deleted()
 

Re: TD_ERASERECORD ERROR

Posted: Thu Jun 20, 2019 5:48 am
by nageswaragunupudi
We will look into this.

Re: TD_ERASERECORD ERROR

Posted: Thu Jun 20, 2019 7:42 am
by Silvio.Falconi
Nages,
It does seem to handle the fieldtype @, but not +

Re: TD_ERASERECORD ERROR

Posted: Thu Jun 20, 2019 8:07 am
by nageswaragunupudi
I tried this program and did not get any runtime error.
Please copy this program to your fwh\samples folder and run with buildh.bat

Code: Select all

#include "fivewin.ch"

REQUEST DBFCDX

function tdatab_test()

   local oDbf

   DbCreate( "EL"    ,{  { "ELNUMERO"   , "+",    2, 0 },; //NUMERO
                         { "ELORDINE"   , "N",    2, 0 },; //ORDINE
                         { "ELNOME"     , "C",   30, 0 },; //DESC
                         { "ELCOLORE"   , "C",   30, 0 },; //COLORE
                         { "ELATTIVO"   , "L",    1, 0 },; // ATTIVO
                         { "ELIMGLIB"   , "C",  120, 0 },; // LIBERO
                         { "ELIMGOCC"   , "C",  120, 0 },; // OCCUPATO
                         { "ELIMGALT"   , "C",  120, 0 },; //DISEGNO
                         { "ELLOCK"     , "L",    1, 0 }}, 'DBFCDX')


   oDbf  := TDatabase():Open( nil, "EL", "DBFCDX", .t. )

   oDbf:Append()
   oDbf:Append()

   XBROWSER oDbf FASTEDIT

return nil
 
Can you prepare a small sample to reproduce the error?