CDaoRecordset::GetValidationRule

CString GetValidationRule( );
throw( CDaoException, CMemoryException );

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

Call this member function to determine the rule used to validate data. 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 more information about  creating recordsets, see the article DAO Recordset: Creating Recordsets in Visual C++ Programmer's Guide. For related information, see the topic "ValidationRule Property" in DAO Help.

CDaoRecordset OverviewClass MembersHierarchy Chart

See Also   CDaoRecordset::GetValidationText