CDBPropSet 类

DBPROPSET 结构进行继承,并添加初始化键字段以及 AddProperty 访问方法的构造函数。

语法

class CDBPropSet : public tagDBPROPSET

要求

标头: atldbcli.h

成员

方法

名称 描述
AddProperty 将属性添加到属性集。
CDBPropSet 构造函数。
SetGUID 设置 DBPROPSET 结构的 guidPropertySet 字段。

运算符

名称 描述
operator = 将一个属性集的内容分配给另一个属性集。

注解

OLE DB 提供程序和使用者使用 DBPROPSET 结构传递 DBPROP 结构的数组。 每个 DBPROP 结构表示可以设置的单个属性。

CDBPropSet::AddProperty

将属性添加到属性集。

语法

bool AddProperty(DWORD dwPropertyID,
   constVARIANT& var,
   DBPROPOPTIONS propoptions = DBPROPOPTIONS_REQUIRED) throw();bool AddProperty(DWORD dwPropertyID,
   LPCSTR szValue,  DBPROPOPTIONS propoptions = DBPROPOPTIONS_REQUIRED) throw();bool AddProperty(DWORD dwPropertyID,
   LPCWSTR szValue,DBPROPOPTIONS propoptions = DBPROPOPTIONS_REQUIRED) throw();bool AddProperty(DWORD dwPropertyID,
   bool bValue,  DBPROPOPTIONS propoptions = DBPROPOPTIONS_REQUIRED) throw();bool AddProperty(DWORD dwPropertyID,
   BYTE bValue,  DBPROPOPTIONS propoptions = DBPROPOPTIONS_REQUIRED);bool AddProperty(DWORD dwPropertyID,
   short nValue,  DBPROPOPTIONS propoptions = DBPROPOPTIONS_REQUIRED);bool AddProperty(DWORD dwPropertyID,
   long nValue,  DBPROPOPTIONS propoptions = DBPROPOPTIONS_REQUIRED);bool AddProperty(DWORD dwPropertyID,
   float fltValue,  DBPROPOPTIONS propoptions = DBPROPOPTIONS_REQUIRED);bool AddProperty(DWORD dwPropertyID,
   double dblValue,  DBPROPOPTIONS propoptions = DBPROPOPTIONS_REQUIRED) throw();bool AddProperty(DWORD dwPropertyID,
   CY cyValue,  DBPROPOPTIONS propoptions = DBPROPOPTIONS_REQUIRED) throw();

参数

dwPropertyID
[in] 要添加的属性的 ID。 用于初始化添加到属性集的 DBPROP 结构的 dwPropertyID

var
[in] 一个变量,用于初始化添加到属性集的 DBPROP 结构的属性值。

szValue
[in] 一个字符串,用于初始化添加到属性集的 DBPROP 结构的属性值。

bValue
[in] 一个 BYTE 或布尔值,用于初始化添加到属性集的 DBPROP 结构的属性值。

nValue
[in] 一个整数值,用于初始化添加到属性集的 DBPROP 结构的属性值。

fltValue
[in] 一个浮点值,用于初始化添加到属性集的 DBPROP 结构的属性值。

dblValue
[in] 一个双精度浮点值,用于初始化添加到属性集的 DBPROP 结构的属性值。

cyValue
[in] 一个 CY 货币值,用于初始化添加到属性集的 DBPROP 结构的属性值。

返回值

如果成功添加属性,则为 true。 否则为 false

CDBPropSet::CDBPropSet

构造函数。 初始化 DBPROPSET 结构的 rgPropertiescPropertiesguidPropertySet 字段。

语法

CDBPropSet(const GUID& guid);

CDBPropSet(const CDBPropSet& propset);

CDBPropSet();

参数

guid
[in] 用于初始化 guidPropertySet 字段的 GUID。

propset
[in] 复制构造的另一个 CDBPropSet 对象。

CDBPropSet::SetGUID

设置 DBPROPSET 结构中的 guidPropertySet 字段。

语法

void SetGUID(const GUID& guid) throw();

参数

guid
[in] 用于设置 DBPROPSET 结构的 guidPropertySet 字段的 GUID。

注解

此字段也可以通过构造函数进行设置。

CDBPropSet::operator =

将一个属性集的内容分配给另一属性集。

语法

CDBPropSet& operator =(CDBPropSet& propset) throw();

另请参阅

OLE DB 使用者模板
OLE DB 使用者模板参考
CDBPropIDSet 类
DBPROPSET 结构DBPROP 结构