共用方式為


CDataSource::OpenWithServiceComponents

使用在 oledb32.dll,的 Serviced 元件開啟資料來源物件。

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

參數

  • clsid
    [in] 資料提供者的 CLSID

  • szProgID
    [in] 資料提供者的程式 ID。

  • pPropset
    [in] 物件陣列的指標包含屬性和值的 DBPROPSET 結構會設定。 請參閱 *《 OLE DB 程式設計人員參考》*的屬性集合和屬性群組 Windows SDK。 如果資料來源物件使用,屬性必須屬於資料來源屬性群組。 如果的屬性在值的 pPropset指定了,則是提供者特定的。 如果 ulPropSets 為零,則忽略這個參數。

  • ulPropSets
    [in] DBPROPSET 結構數目pPropSet 引數傳遞的。 如果這是零,提供者會忽略 pPropset。

傳回值

標準版 HRESULT

備註

使用在 oledb32.dll,的 Serviced 元件這個方法會開啟資料來源物件;這個 DLL 包含 Serviced 元件功能的實作 (例如資源共用,自動交易登記,依此類推。 如需詳細資訊,請參閱《OLE DB 程式設計人員參考》中的「OLE DB 服務」 https://msdn.microsoft.com/library/default.asp?url=/library/en-us/oledb/htm/oledbole_db_services.asp?frame=true

需求

標題: atldbcli.h

請參閱

參考

CDataSource 類別