Partilhar via


CDaoRecordset::GetValidationRule

Call this member function to determine the rule used to validate data.

CString GetValidationRule( );

Return Value

A CString object containing a value that validates the data in a record as it is changed or added to a table.

Remarks

This rule is text-based, and is applied each time the underlying table is changed. If the data is not legal, MFC throws an exception. The returned error message is the text of the ValidationText property of the underlying field object, if specified, or the text of the expression specified by the ValidationRule property of the underlying field object. You can call GetValidationText to obtain the text of the error message.

For example, a field in a record that requires the day of the month might have a validation rule such as "DAY BETWEEN 1 AND 31."

For related information, see the topic "ValidationRule Property" in DAO Help.

Requirements

Header: afxdao.h

See Also

Reference

CDaoRecordset Class

Hierarchy Chart

CDaoRecordset::GetValidationText

Other Resources

CDaoRecordset Members