CDBVariant对象 表示用于MFC ODBC类的可变数据类型

来源:互联网 发布:java校招笔试题 编辑:程序博客网 时间:2024/06/05 20:03
CDBVariant对象 表示用于MFC ODBC类的可变数据类型
2010-10-21 23:59

http://msdn.microsoft.com/zh-cn/library/t7yk8s5d(v=VS.90).aspx

  CDBVariant没有基类。

  CDBVariant对象表示用于MFC ODBC类的可变数据类型。CDBVariant与COleVariant类似;不过CDBVariant不使用OLE。CDBVariant允许存储值而不必关心值的数据类型。CDBVariant跟踪保存在一个联合中的当前值数据类型。
  类CRecordset在三个成员函数中利用CDBVariant对象:GetFieldValue,GetBookmark和SetBookmark。例如GetFieldValue允许动态取一个列中的数据。因为运行时可能不知道列的数据类型,GetFieldValue使用一个CDBVariant对象来存储列的数据。

  所需头文件:#include <afxdb.h>

Data Members

m_boolVal

Contains a value of type BOOL.

m_chVal

Contains a value of type unsigned char.

m_dblVal

Contains a value of type double.

m_dwType

Contains the data type of the currently stored value. Type DWORD.

m_fltVal

Contains a value of type float.

m_iVal

Contains a value of type short.

m_lVal

Contains a value of type long.

m_pbinary

Contains a pointer to an object of type CLongBinary.

m_pdate

Contains a pointer to an object of type TIMESTAMP_STRUCT.

m_pstring

Contains a pointer to an object of type CString.

m_pstringA

Stores a pointer to an ASCII CString object.

m_pstringW

Stores a pointer to a wide CString object.

Construction

CDBVariant

Constructs a CDBVariant object.

Operations

Clear

Clears the CDBVariant object.

See Also

Concepts

CDBVariant Class
Hierarchy Chart
原创粉丝点击