DB.TField.CustomConstraint

From RAD Studio VCL Reference
Jump to: navigation, search

Contents

Delphi Information

From DB.pas

	property CustomConstraint: string read FCustomConstraint write FCustomConstraint;


Unit: DB

Type: property

Visibility: published

Member Of: TField

C++ Information

From DB.hpp

	__property System::UnicodeString CustomConstraint = {read=FCustomConstraint,write=FCustomConstraint};


Unit: DB

Type: property

Visibility: public

Member Of: TField

Description

Specifies an SQL string the enforces any application-specific constraints on the field's value.


Set CustomConstraint to limit the values that the user can enter into a field. CustomConstraint must be a valid SQL search expression such as

x > 0 and x < 100

The name used to refer to the field's value can be any string that is not a reserved SQL keyword, as long as it is used consistently throughout the constraint expression.

Custom constraints are imposed in addition to any constraints to the field's value that come from the server. To see the constraints imposed by the server, read the ImportedConstraint property.

Note:  When setting the CustomConstraint property, be sure to set the ConstraintErrorMessage property as well, so that a message can appear when the user enters a value that violates the custom constraint.
Note:  Custom constraints are SQL expressions. Because of this, always use a period (.) as a floating-point separator. This may be inconsistent with international Windows environment settings.

See Also

Personal tools
Translations
Newest Version