FireDAC.Comp.DataSet.TFDDataSet.SetFieldAttributes

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type:
procedure
function
Visibility: public
Source:
FireDAC.Comp.DataSet.pas
FireDAC.Comp.DataSet.hpp
Unit: FireDAC.Comp.DataSet
Parent: TFDDataSet

Delphi

procedure SetFieldAttributes(AField: TField; AColumn: TFDDatSColumn); overload;
procedure SetFieldAttributes(ALifeCycles: TFieldLifeCycles; AFields: TFields); overload;
procedure SetFieldAttributes(ALifeCycles: TFieldLifeCycles); overload;

C++

void __fastcall SetFieldAttributes(Data::Db::TField* AField, Firedac::Dats::TFDDatSColumn* AColumn)/* overload */;
void __fastcall SetFieldAttributes(Data::Db::TFieldLifeCycles ALifeCycles, Data::Db::TFields* AFields)/* overload */;
void __fastcall SetFieldAttributes(Data::Db::TFieldLifeCycles ALifeCycles)/* overload */;

Description

Sets up the ProviderFlags fields.

Use the SetFieldAttributes method to set up the dataset ProviderFlags fields and some others properties. FireDAC datasets are doing that automatically when:

  • The dataset uses temporary fields.
  • The programmer is adding persistent fields at design time.

When the application is creating fields manually or by using the CreateFields method, then the above properties are not automatically set up. To set them up, call the SetFieldAttributes method after the dataset is opened.

Example

FDQuery1.FieldDefs.Updated := False;
FDQuery1.FieldDefs.Update;
FDQuery1.CreateFields;
....
FDQuery1.Open;
FDQuery1.SetFieldAttributes;

See Also