Share via


CDataSource::OpenWithServiceComponents

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at CDataSource::OpenWithServiceComponents.

Opens a data source object using the service components in oledb32.dll.

Syntax

  
      HRESULT OpenWithServiceComponents (  
   const CLSID clsid,  
   DBPROPSET* pPropset = NULL,  
   ULONG ulPropSets = 1   
);  
HRESULT OpenWithServiceComponents (  
   LPCSTR szProgID,  
   DBPROPSET* pPropset = NULL,  
   ULONG ulPropSets = 1   
);  

Parameters

clsid
[in] The CLSID of a data provider.

szProgID
[in] Program ID of a data provider.

pPropset
[in] A pointer to an array of DBPROPSET structures containing properties and values to be set. See Property Sets and Property Groups in the OLE DB Programmer's Reference in the Windows SDK. If the data source object is initialized, the properties must belong to the Data Source property group. If the same property is specified more than once in pPropset, then which value is used is provider-specific. If ulPropSets is zero, this parameter is ignored.

ulPropSets
[in] The number of DBPROPSET structures passed in the pPropSet argument. If this is zero, the provider ignores pPropset.

Return Value

A standard HRESULT.

Remarks

This method opens a data source object using the service components in oledb32.dll; this DLL contains the implementation of Service Components features such as Resource Pooling, Automatic Transaction Enlistment, and so on. For more information, see "OLE DB Services" in the OLE DB Programmer's Reference at https://msdn.microsoft.com/library/default.asp?url=/library/oledb/htm/oledbole_db_services.asp?frame=true.

Requirements

Header: atldbcli.h

See Also

CDataSource Class