แก้ไข

แชร์ผ่าน


CDBPropSet Class

Inherits from the DBPROPSET structure and adds a constructor that initializes key fields as well as the AddProperty access method.

Syntax

class CDBPropSet : public tagDBPROPSET

Requirements

Header: atldbcli.h

Members

Methods

Name Description
AddProperty Adds a property to the property set.
CDBPropSet Constructor.
SetGUID Sets the guidPropertySet field of the DBPROPSET structure.

Operators

Name Description
operator = Assigns the contents of one property set to another.

Remarks

OLE DB providers and consumers use DBPROPSET structures to pass arrays of DBPROP structures. Each DBPROP structure represents a single property that can be set.

CDBPropSet::AddProperty

Adds a property to the property set.

Syntax

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();

Parameters

dwPropertyID
[in] The ID of the property to be added. Used to initialize the dwPropertyID of the DBPROP structure added to the property set.

var
[in] A variant used to initialize the property value for the DBPROP structure added to the property set.

szValue
[in] A string used to initialize the property value for the DBPROP structure added to the property set.

bValue
[in] A BYTE or boolean value used to initialize the property value for the DBPROP structure added to the property set.

nValue
[in] An integer value used to initialize the property value for the DBPROP structure added to the property set.

fltValue
[in] A floating-point value used to initialize the property value for the DBPROP structure added to the property set.

dblValue
[in] A double-precision floating-point value used to initialize the property value for the DBPROP structure added to the property set.

cyValue
[in] A CY currency value used to initialize the property value for the DBPROP structure added to the property set.

Return Value

true if the property was successfully added. Otherwise, false.

CDBPropSet::CDBPropSet

The constructor. Initializes the rgProperties, cProperties, and guidPropertySet fields of the DBPROPSET structure.

Syntax

CDBPropSet(const GUID& guid);

CDBPropSet(const CDBPropSet& propset);

CDBPropSet();

Parameters

guid
[in] A GUID used to initialize the guidPropertySet field.

propset
[in] Another CDBPropSet object for copy construction.

CDBPropSet::SetGUID

Sets the guidPropertySet field in the DBPROPSET structure.

Syntax

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

Parameters

guid
[in] A GUID used to set the guidPropertySet field of the DBPROPSET structure.

Remarks

This field can be set by the constructor as well.

CDBPropSet::operator =

Assigns the contents of one property set to another property set.

Syntax

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

See also

OLE DB Consumer Templates
OLE DB Consumer Templates Reference
CDBPropIDSet Class
DBPROPSET Structure DBPROP Structure