Microsoft KB Archive/833388

= You cannot create out-of-process providers with MDAC OLE DB components =

Article ID: 833388

Article Last Modified on 12/30/2003

-

APPLIES TO


 * Microsoft Data Access Components 2.8
 * Microsoft Data Access Components 2.8

-





SUMMARY
You cannot create out-of-process providers with Microsoft Data Access (MDAC) OLE DB components.



MORE INFORMATION
You cannot marshal OLE DB interfaces across process boundaries with MDAC OLE DB components. MSDAPS.dll is a Component Object Model (COM) proxy-stub DLL. Although MSDAPS.dll is available for OLE DB, you can only use this DLL with Microsoft SQL Server. You can invoke provider components as out-of-process components in SQL Server. MSDAPS.dll handles only the interfaces that SQL Server uses, and MSDAPS.dll is tested only for SQL Server. Therefore, you can only use the MSDAPS.dll DLL with SQL Server.

To use MDAC OLE DB components to create in-process providers, specify the CLSCTX_INPROC_SERVER enumeration value for the dwClsContext parameter when you call the CoCreateInstance method. To do this, use code that is similar to the following code:

OLE DB 1.x
CoCreateInstance(CLSID_MSDASQL, NULL, CLSCTX_INPROC_SERVER, IID_IDBInitialize,(void**)pIDBInitialize);

OLE DB 2.0 and later
CoCreateInstance(CLSID_MSDAINITIALIZE, NULL, CLSCTX_INPROC_SERVER, IID_IDataInitialize,(void**)&pIDataInitialize); Additionally, specify the CLSCTX_INPROC_SERVER enumeration value for the dwClsCtx parameter when you call the CreateDBInstance method. To do this, use code that is similar to the following code: pIDataInitialize->CreateDBInstance(CLSID_MSDASQL, NULL, CLSCTX_INPROC_SERVER,NULL, IID_IDBInitialize,(IUnknown**)&pIDBInitialize);

Additional query words: MDAC, OLE DB provider, component, marshaling, out-of-process

Keywords: kbinfo kbcompmodel kbprovider kbdll kbcominterop KB833388

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.