Поделиться через


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 
);

Параметры

  • 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.

Возвращаемое значение

Nonzero if the specified field data member is flagged as Null; otherwise 0.

Заметки

(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.

Требования

Header: afxdao.h

См. также

Основные понятия

CDaoRecordset Class

CDaoRecordset Members

Hierarchy Chart

CDaoRecordset::IsFieldDirty

CDaoRecordset::IsFieldNullable