War diese Seite hilfreich?
Ihr Feedback ist uns wichtig. Teilen Sie uns Ihre Meinung mit.
Weiteres Feedback?
1500 verbleibende Zeichen
Exportieren (0) Drucken
Alle erweitern
MFC
Erweitern Minimieren
Wichtig Dieses Dokument enthält ggf. nicht die bewährten Methoden für die aktuelle Entwicklung. Außerdem sind Links zu Downloads und anderen Ressourcen u. U. nicht mehr gültig. Die aktuell empfohlene Version finden Sie hier.

CRecordset::IsFieldNullable

Returns nonzero if the specified field in the current record can be set to Null (having no value).


BOOL IsFieldNullable( 
   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 can be set to a Null value.

Call this member function to determine whether the specified field data member is "nullable" (can be set to a Null value; C++ NULL is not the same as Null, which, in database terminology, means "having no value").

Note Note:

If you have implemented bulk row fetching, you cannot call IsFieldNullable. Instead, call the GetODBCFieldInfo member function to determine whether a field can be set to a Null value. Note that you can always call GetODBCFieldInfo, regardless of whether you have implemented bulk row fetching. For more information about bulk row fetching, see the article Recordset: Fetching Records in Bulk (ODBC).

A field that cannot be Null must have a value. If you attempt to set a such a field to Null when adding or updating a record, the data source rejects the addition or update, and Update will throw an exception. The exception occurs when you call Update, not when you call SetFieldNull.

Using NULL for the first argument of the function will apply the function only to outputColumn fields, not param fields. For instance, the call

SetFieldNull(NULL);


will set only outputColumn fields to NULL; param fields will be unaffected.

To work on param fields, you must supply the actual address of the individual param you want to work on, such as:

SetFieldNull(&m_strParam);


This means you cannot set all param fields to NULL, as you can with outputColumn fields.

IsFieldNullable is implemented through DoFieldExchange.

This method can throw exceptions of type CDBException*.

Header: afxdb.h

Community-Beiträge

HINZUFÜGEN
Anzeigen:
© 2015 Microsoft