delphi - How to read field values of a TDataSet descendant without having to move its cursor -
i see having ability read record values tdataset descendant without having move cursor big improvement people working database applications.
i have searched long , hard on topic closest can find in xe7 tfdmemtable can read field values statements this:
firstname := fdspeople.table.rows.itemsi[i].getvalues('firstname', true);
where
- fdspeople = instance of tfdmemtable
- i = integer referring record index
- firstname string variable
is there way achieve tdataset not aware of? if not, how can request feature ?
you can clone cursor dataset other datasets, if dataset descendant supports feature ofcourse. (anydac - tadmemtable or firedac - tfdmemtable , , tclientdataset support feature).
it means datasets can share data, have different cursors! (you can walk 1 dataset without disturbing other dataset recno)
example:
procedure myclonecursor(asourceds, adestds: tfdmemtable) begin adestds.fielddefs.assign(asourceds.fielddefs); adestds.createdataset; adestds.clonecursor(asourceds, false {reset}, false {keepsettings}); end;
be aware keepsettings refers datasets cloned cursor. keepsettings, if true, indicates dataset cloned cursor keep it's settings, , if false take settings dataset cursor cloned.
if want clone filter, indexes, master source, master fields, read-only status of source dataset ... call clonecursor follows
clonecursor(sourcedataset, false, false);
for extensive documentation on this, read cary jensen's cloning clientdataset cursors
Comments
Post a Comment