VirtualDAC

TVirtualTable.AddField Method

Adds a new TFieldDef object with the name determined by Name.

Class

TVirtualTable

Syntax

procedure AddField(const Name: string; FieldType: TFieldType; Size: integer = 0; Required: boolean = False);

Parameters
Name
Holds the name of the TFieldDef object to add.
FieldType
Holds the type of the TFieldDef object to add.
Size
Holds the size of the string (if the type of TFieldDef object was specifiad as ftString or ftWideString).
Required
Holds an indicator that determines whether filling the Size parameter is required.

Remarks

Call the AddField method to add a new TFieldDef object with the name determined by Name. FieldType can be ftString, ftWideString, ftSmallint, ftInteger, ftAutoInc, ftWord, ftBoolean, ftLargeint, ftFloat, ftCurrency, ftDate, ftTime, ftDateTime, ftBlob, or ftMemo. When you add ftString or ftWideString field you should specify Size of the string. When the ftAutoInc field type is set, a field of the special TVirtualAutoIncField type will be created in the virtual table, which can generate auto-increment field values.

Example

VirtualTable1.AddField('CODE', ftInteger, 0);
VirtualTable1.AddField('NAME', ftString, 30); 

See Also

© 1997-2024 Devart. All Rights Reserved. Request Support DAC Forum Provide Feedback