Partager via


CDBVariant Class

Represents a variant data type for the MFC ODBC classes.

class CDBVariant

Remarks

CDBVariant does not have a base class.

CDBVariant is similar to COleVariant; however, CDBVariant does not use OLE. CDBVariant allows you to store a value without worrying about the value's data type. CDBVariant tracks the data type of the current value, which is stored in a union.

Class CRecordset utilizes CDBVariant objects in three member functions: GetFieldValue, GetBookmark, and SetBookmark. For example, GetFieldValue allows you to dynamically fetch data in a column. Because the data type of the column may not be known at run time, GetFieldValue uses a CDBVariant object to store the column's data.

Requirements

Header: afxdb.h

See Also

Concepts

CDBVariant Members

Hierarchy Chart

CRecordset Class

CRecordset::GetFieldValue

CRecordset::GetBookmark

CRecordset::SetBookmark