duplicate record (tdatarow)

duplicate record (tdatarow)

Postby Silvio.Falconi » Wed Jun 02, 2021 8:39 am

on tdatabase to inser ta a record I use

oElemento:=oElementi:record(.t.)

and to modify

oElemento:=oElementi:record()

How I can make to have a duplicate record to modify ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7063
Joined: Thu Oct 18, 2012 7:17 pm

Re: duplicate record (tdatarow)

Postby nageswaragunupudi » Thu Jun 03, 2021 3:13 am

Code: Select all  Expand view  RUN

oRec  := oDbf:Record()  // existing record
oRec:Copy()
oRec  := oDbf:Record( .t. ) // new record to append
oRec:Paste()
oRec:Edit()
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: duplicate record (tdatarow)

Postby Silvio.Falconi » Thu Jun 03, 2021 9:01 am

thanks
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7063
Joined: Thu Oct 18, 2012 7:17 pm

Re: duplicate record (tdatarow)

Postby Silvio.Falconi » Sun Jun 06, 2021 7:57 pm

Nages, do you think it is right ?

oElementi:= TDatabase():Open( , cDir+"Elementi", "DBFCDX", .T. )
oElementi:setorder(1)
oElementi:gotop()

//sample for duplicate
oElemento:=Editsetup(oElementi,3,oElemento)

Code: Select all  Expand view  RUN


Function Editsetup(oDbf,nMode,oRec)
    IF nMode==1  //add
     oRec  := oDbf:record(.t.)
    Elseif nMode == 2  //mod
     oRec  := oDbf:record()
    elseif nMode:= 3  //duplicate
        oRec  := oDbf:Record()  // existing record
        oRec:Copy()
        oRec  := oDbf:Record( .t. ) // new record to append
        oRec:Paste()
        //oRec:Edit()
   Endif
return oRec
 
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7063
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 47 guests