BOOL IsFieldNull( void* pv );
throw( CDaoException, CMemoryException );
Return Value
Nonzero if the specified field data member is flagged as Null; 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 Null.
Remarks
Call this member function to determine whether the specified field data member of a recordset has been flagged as Null. (In database terminology, Null means “having no value” and is not the same as NULL in C++.) If a field data member is flagged as Null, it is interpreted as a column of the current record for which there is no value.
Note In certain situations, using IsFieldNull can be inefficient, as the following code example illustrates:
COleVariant varValue;
int nField;
// this code is inefficient because data
// must be retrieved for both IsFieldNull
// and GetFieldValue
if ( !rs.IsFieldNull( pField ) )
rs.GetFieldValue( nField, varValue );
// this code is more efficient
rs.GetFieldValue( nField, varValue );
if ( varValue.vt == VT_NULL )
// do something
Note If you are using dynamic record binding, without deriving from CDaoRecordset, be sure to use VT_NULL as shown in the example.
CDaoRecordset Overview | Class Members | Hierarchy Chart
See Also CDaoRecordset::IsFieldDirty, CDaoRecordset::IsFieldNullable