Sybase 2 Barcode Reader User Manual


 
Defining validation rules
258 DataWindow .NET
To modify a validation rule:
1 In the Database painter, open the Extended Attributes view.
2 In the Extended Attributes view, open the list of validation rules.
3 Position the pointer on the validation rule you want to modify, display the
pop-up menu, and select Properties.
4 In the Validation Rule view, modify the validation rule as desired.
For information, see “Defining the expression” on page 258 and
“Customizing the error message” on page 260.
To associate a validation rule with a column in the Database painter:
1 In the Database painter (Objects view), position the pointer on the column,
select Properties from the column’s pop-up menu, and select the
Validation tab.
2 Select a validation rule from the Validation Rule drop-down list.
The column now has the selected validation rule associated with it in the
extended attribute system tables. Whenever you use this column in a
DataWindow object, it will use this validation rule unless you override it
in the DataWindow painter.
To remove a validation rule from a column in the Database painter:
1 In the Database painter (Objects view), position the pointer on the column,
select Properties from its pop-up menu, and select the Validation tab in the
Properties view.
2 Select (None) from the list in the Validation Rule drop-down list.
The validation rule is no longer associated with the column.
Defining the expression
A validation rule is a boolean expression. DataWindow Designer applies the
boolean expression to an entered value. If the expression returns
TRUE, the
value is accepted. Otherwise, the value is not accepted and an ItemError event
is triggered.
What expressions can
contain
You can use any valid DataWindow expression in validation rules.
Validation rules can include most DataWindow expression functions.
DataWindow expression functions are displayed in the Functions list and can
be pasted into the definition.