|
AnyDAC
|
Specifies whether the dataset perform constraint checking.
Use ConstraintsEnabled to get / set the flag controlling automatic record-level constraints enforcement.
When ConstraintsEnabled is False (the default), the dataset does not check Constraints. This allows the dataset to perform the large data updates without overhead of checking constraints. When ConstraintsEnabled is True, the dataset checks Constraints at at end of data editing (Post / AppendRecord / InsertRecord).
If application needs to perform batch updates to dataset, then set ConstraintsEnabled to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.
property ConstraintsEnabled: Boolean;
Constraints, BeginBatch, EndBatch, DisableConstraints, EnableConstraints, TDataSet.Post, TDataSet.AppendRecord, TDataSet.InsertRecord, TADUpdateOptions.CheckRequired
var lPrevConsEnabled: Boolean; ... lPrevConsEnabled := ADQuery1.ConstraintEnabled; ADQuery1.ConstraintEnabled := False; try // perform updates here, without checking client constraints finally ADQuery1.ConstraintEnabled := lPrevConsEnabled; end;
|
What do you think about this topic? Send feedback!
|