Data.DB.TFieldDefs.Add

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type:
procedure
function
Visibility: public
Source:
Data.DB.pas
Data.DB.hpp
Unit: Data.DB
Parent: TFieldDefs

Delphi

procedure Add(const Name: string; DataType: TFieldType; Size: Integer = 0;
Required: Boolean = False);

C++

HIDESBASE void __fastcall Add(const System::UnicodeString Name, TFieldType DataType, int Size = 0x0, bool Required = false);

Description

Creates a new field definition object and adds it to the Items property.

Add is provided for backward compatibility. The recommended way to add new field definitions to the Items property array is using the AddFieldDef method.

Add uses the values passed in the Name, DataType, Size, and Required parameters and assigns them to the respective properties of the new field definition object.

If a field definition with same name already exists, Add raises an EDatabaseError exception.

See Also