RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TFieldDef Class

TFieldDef is a field definition that corresponds to a physical field of a record in a table underlying a dataset.

Pascal
TFieldDef = class(TNamedItem);
C++
class TFieldDef : public TNamedItem;

A TFieldDef object contains the definition of one field in a table. The definition for a field includes such attributes as the field's name, data type, and size. TFieldDef objects are typically used in collections of such objects, such as the FieldDefs property of the TDataSet component. 

There are two primary reasons for working with TFieldDef objects: 

To obtain information about field types in a dataset without opening the dataset. 

To specify field definitions for a new table. 

When using an existing table, a field definition is automatically created for each field in the dataset that comes from the underlying database. Inspect the properties of TFieldDef to retrieve information about specific fields in the dataset. 

When creating new tables, such as with the CreateTable method of TTableor the CreateDataSet method of TClientDataSet, TFieldDef objects supply the definitions for the new fields that will comprise the new table. 

A field definition has a corresponding TField object, but not all TField objects have a corresponding field definition. For example, calculated fields do not have field definition objects. 

 

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