FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Request For TDataRow Example for MariDB
Posts: 76
Joined: Fri Aug 28, 2009 05:25 AM
Request For TDataRow Example for MariDB
Posted: Mon Jul 31, 2023 05:40 PM

Dear Rao Sir ,

I would request you to provide TDatarow Examples of Maridb to understand Tdatarow. I have tried existing examples which are not working for me.

Please provide the same. Thanks in advance..!

Thanks

Shridhar

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Request For TDataRow Example for MariDB
Posted: Tue Aug 01, 2023 03:34 AM
Syntax
Code (fw): Select all Collapse
oRec := TDataRow():New( uSource, [cFieldList], [lAppend] )
uSource can be alias(), ado recordset, oRowSet, or any other datasource.

You can:
Code (fw): Select all Collapse
oRs := oCn:RowSet( cTable )
oRec := TDataRow():New( oRs )
oRec:Edit()
OR simply
Code (fw): Select all Collapse
oRs:Record():Edit()
OR even much simpler
Code (fw): Select all Collapse
oRs := oCn:RowSet( cTable )
oRs:Edit()
All three alternative codes above do exactly the same thing.

The reason why you do not find many examples directly using TDataRow is because you do not need to deal with it explicitly.
XBrowse and classes like RowSet, TRecSet, TDatabase. etc implicity internally use this class to provide Edit()
Regards



G. N. Rao.

Hyderabad, India
Posts: 76
Joined: Fri Aug 28, 2009 05:25 AM
Re: Request For TDataRow Example for MariDB
Posted: Tue Aug 01, 2023 04:58 PM
Dear Sir ,

Not able to access value by using FieldGet Method as given below.
Code (fw): Select all Collapse
    oRec := TDataRow():New( oRsList )
  
    ALERT(" acgrp_name ==> "+oRec:FieldGet("ACGRP_NAME") )
Thanks
Shridhar
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Request For TDataRow Example for MariDB
Posted: Tue Aug 01, 2023 09:43 PM
Code (fw): Select all Collapse
? oRec:fieldname
// or
@ r,c GET oRec:fieldname SIZE w,h PIXEL OF oDlg
Finally,
Code (fw): Select all Collapse
oRec:Save()
Regards



G. N. Rao.

Hyderabad, India
Posts: 76
Joined: Fri Aug 28, 2009 05:25 AM
Re: Request For TDataRow Example for MariDB
Posted: Wed Aug 02, 2023 05:53 AM

Dear Rao Sir ,

Many Thanks ! Its working as expected.

Thanks

Shridhar

Continue the discussion