CDaoRecordset::IsFieldNull
Call this member function to determine whether the specified field data member of a recordset has been flagged as Null.
BOOL IsFieldNull(
void* pv
);
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.
Return Value
Nonzero if the specified field data member is flagged as Null; otherwise 0.
Remarks
(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.
注意
In certain situations, using IsFieldNull can be inefficient, as the following code example illustrates:
COleVariant varValue;
void* pField = &(rs.m_Age);
int nField = 2;
// 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)
varValue.Attach(varNewVal);// do something
注意
If you are using dynamic record binding, without deriving from CDaoRecordset, be sure to use VT_NULL as shown in the example.
Requirements
Header: afxdao.h
See Also
Reference
CDaoRecordset::IsFieldNullable