RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TFieldDefs Class

TFieldDefs holds the field definition (TFieldDef) objects that represent the physical fields underlying a dataset.

Pascal
TFieldDefs = class(TDefCollection);
C++
class TFieldDefs : public TDefCollection;

Datasets use TFieldDefs to manage the field definitions they use to create field objects that correspond to fields in a database table. Every field definition listed by TFieldDefs has a corresponding TField object, but not all TField objects have a corresponding field definition. For example, calculated fields do not have field definitions. 

TTable and TClientDataSet objects also use TFieldDefs when creating a new table. 

With object field types, such as TADTField and TArrayField, there are two ways to represent the field definitions: hierarchically or flattened. When represented hierarchically, object field definitions contain a set of child definitions for the constituent subfields. When represented as a flattened set, child field definitions appear as siblings sequentially after the parent field definition. 

TFieldDefs stores field definitions hierarchically. This is in contrast to TFieldDefList, which lists the child TFieldDef objects of object fields sequentially after the parent TFieldDef

Use the properties and methods of TFieldDefs to: 

Access a specific field definition. 

Add or delete field definitions from the list (when creating new tables). 

Find out how many fields are defined. 

Copy a set of field definitions to another dataset. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!