Monday, 15 June 2015

delphi - How to read field values of a TDataSet descendant without having to move its cursor -


I see the ability to read record values ​​from a TDataSet lineage without transferring the cursor to big improvements for the database applications

I have searched this topic for long and hard but the closest search is to the XE7 TFDMemTable, where you can read field values ​​with such statements:

 < Code> FirstName: = FdsPeople.Table.Rows.ItemsI [i] .GetValues ​​('FirstName', true);  
  • FirstName Is there a string variable

    Is there a way to get it with a TDTasset that I do not know? If not, how can we request for this feature?

    You can clone the cursor from your dataset to another dataset, if your dataset is descended from this feature Supports course. (AnyDAC - TADMemTable or FireDAC - TFDMemTable, and TClientDataset supports this feature).

    This means that datasets can share data, but they have a different cursor! (You can run even if you do not have another dataset REC by a dataset)

    Example:

      Process MyCloneCursor (ASOSSS, ADESDS: TFDML) ADESDS Field DefacesAssign (ASOSDS FieldDefs); ADestDS.CreateDataset; ADestDS.CloneCursor (ASourceDS, false {reset}, false {KeepSettings}); End;  

    Be aware that KeepSettings refers to a dataset that clones the cursor. KeepSettings, if true, indicates that the dataset that will clone the cursor will keep its settings, and if it is wrong, the settings will be taken from the dataset to which the cursor was cloned.

    If you call the clone cursor as the filter, indexed, master source, master field, source dataset, then call the cluster cursor

      clone casser (source Dataset, false, false);  

    For detailed documentation on this, Carey Jensen's


  • No comments:

    Post a Comment