CDBPropSet 類別
繼承自 結構, DBPROPSET
並新增建構函式,以初始化索引鍵字段以及 AddProperty
存取方法。
語法
class CDBPropSet : public tagDBPROPSET
需求
標頭檔:atldbcli.h
成員
方法
名稱 | 描述 |
---|---|
AddProperty | 將屬性加入至屬性集。 |
CDBPropSet | 建構函式。 |
SetGUID | guidPropertySet 設定結構的欄位DBPROPSET 。 |
操作員
名稱 | 描述 |
---|---|
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]要加入之屬性的標識碼。 用來初始化 dwPropertyID
加入至屬性集之 DBPROP
結構的 。
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
建構函式。 rgProperties
初始化 DBPROPSET 結構的、 cProperties
和欄位。guidPropertySet
語法
CDBPropSet(const GUID& guid);
CDBPropSet(const CDBPropSet& propset);
CDBPropSet();
參數
guid
[in]用來初始化欄位的 guidPropertySet
GUID。
propset
[in] 複製建構的另一個 CDBPropSet
物件。
CDBPropSet::SetGUID
guidPropertySet
設定結構中的DBPROPSET
欄位。
語法
void SetGUID(const GUID& guid) throw();
參數
guid
[in]用來設定 guidPropertySet
DBPROPSET 結構的欄位的 GUID。
備註
建構函式也可以設定此欄位。
CDBPropSet::operator =
將一個屬性集的內容指派給另一個屬性集。
語法
CDBPropSet& operator =(CDBPropSet& propset) throw();
另請參閱
OLE DB 消費者範本
OLE DB 消費者範本參考
CDBPropIDSet 類別
DBPROPSET 結構DBPROP結構