CRecordset::IsFieldDirty

BOOL IsFieldDirty( void* pv );
throw( CMemoryException );

Return Value

Nonzero if the specified field data member has changed since calling AddNew or Edit; otherwise 0.

Parameters

pv

A pointer to the field data member whose status you want to check, or NULL to determine if any of the fields are dirty.

Remarks

Call this member function to determine whether the specified field data member has been changed since Edit or AddNew was called. The data in all dirty field data members will be transferred to the record on the data source when the current record is updated by a call to the Update member function of CRecordset (following a call to Edit or AddNew).

Note   This member function is not applicable on recordsets that are using bulk row fetching. If you have implemented bulk row fetching, then IsFieldDirty will always return FALSE and will result in a failed assertion. For more information about bulk row fetching, see the article Recordset: Fetching Records in Bulk (ODBC) in Visual C++ Programmer’s Guide.

Calling IsFieldDirty will reset the effects of preceding calls to SetFieldDirty since the dirty status of the field is re-evaluated. In the AddNew case, if the current field value differs from the pseudo null value, the field status is set dirty. In the Edit case, if the field value differs from the cached value, then the field status is set dirty.

IsFieldDirty is implemented through DoFieldExchange.

For more information on the dirty flag, see the article Recordset: How Recordsets Select Records (ODBC) in Visual C++ Programmer’s Guide.

CRecordset OverviewClass MembersHierarchy Chart

See Also   CRecordset::SetFieldDirty, CRecordset::IsFieldNull