Data.DB.TAutoIncField
Delphi
TAutoIncField = class(TIntegerField)
C++
class PASCALIMPLEMENTATION TAutoIncField : public TIntegerField
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
class | public | Data.DB.pas Data.DB.hpp |
Data.DB | Data.DB |
Description
TAutoIncField is a persistent field object for an autoincrement field in a dataset.
TAutoIncField provides access to an autoincrement field in a table. Autoincrement fields can hold values in the range -2,147,483,648 to 2,147,483,647, and are used as a counter for the records in the dataset. Each record is given a unique value in an autoincrement field, with each record receiving the next highest integer from that of the previously inserted record. Autoincrement fields are commonly used to provide a unique primary key value for a record.
Note: Auto-incrementing fields are a function of the database back-end. An application should not attempt to set a field value for an autoincrement field (with or without a TAutoIncField object).
If you use the Fields editor at design time to create a persistent field component for the auto-incrementing field, you can access it by name at runtime. When using dynamic field components, you can access the TAutoIncField instance using the dataset's Fields property or FieldByName method.