AnyDAC
ContentsIndexHome
PreviousUpNext
TADDataSet.UpdateConstraints Method

Actualize changes to the client constraints.

Group
Links

Use UpdateConstraints method to actualize changes to the constraints made after dataset was activated. 

The client constraints that are in Constraints property (record constraints) or are assigned to the dataset fields (field constraints) are actualized automatically at dataset Open call. The constraint changes for an active dataset are not actualizing automatically.

procedure UpdateConstraints;
with ADQuery1.FieldByName('age') do begin
  CustomConstraint := 'age >= 18';
  ConstraintErrorMessage := 'The age must be greater or equal to 18 years';
end;
ADQuery1.UpdateConstraints;
What do you think about this topic? Send feedback!