Data.DB.TFieldDef

From RAD Studio API Documentation
Jump to: navigation, search

Data.DB.TNamedItemSystem.Classes.TCollectionItemSystem.Classes.TPersistentSystem.TObjectTFieldDef

Delphi

TFieldDef = class(TNamedItem)

C++

class PASCALIMPLEMENTATION TFieldDef : public TNamedItem

Properties

Type Visibility Source Unit Parent
class public
Data.DB.pas
Data.DB.hpp
Data.DB Data.DB

Description

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

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.

See Also