IDataInitialize::CreateDBInstanceEx

Creates a data source object. Analogous to CoCreateInstanceEx.

HRESULT CreateDBInstanceEx(

   REFCLSID         clsidProvider,
   IUnknown *       pUnkOuter,
   DWORD            dwClsCtx,
   LPOLESTR         pwszReserved,
   COSERVERINFO *   pServerInfo,
   ULONG            cmq,
   MULTI_QI *       rgmqResults);

Parameters

clsidProvider [in]

The CLSID of the provider to instantiate.

pUnkOuter [in]

A pointer to the controlling IUnknown interface if the data source object is being created as a part of an aggregate; otherwise, it is a null pointer.

dwClsCtx [in]

CLSCTX values.

pwszReserved [in]

Reserved for future use; must be NULL.

pServerInfo [in]

Machine on which the data source objects are to be instantiated.

cmq [in]

Number of MULTI_QI structures in rgmqResults.

rgmqResults [in, out]

Array of MULTI_QI structures.

Return Code

S_OK

The method succeeded.

E_FAIL

A provider-specific error occurred.

CO_S_NOTALLINTERFACES

At least one, but not all of the interfaces requested in the rgmqResults array were successfully retrieved.

The hr field of each of the MULTI_QI structures in rgmqResults indicates with S_OK or E_NOINTERFACE whether the specific interface was returned.

E_NOINTERFACE

The data source did not support the interface specified in riid.

riid was IID_NULL.

The object indicated by clsidProvider was not an OLE DB provider.

DB_E_NOAGGREGATION

pUnkOuter was not a null pointer and riid was something other than IID_IUnknown.

pUnkOuter was not a null pointer and the provider does not support aggregation.

pUnkOuter was not a null pointer and dwClsCtx was CLSCTX_LOCAL_SERVER or CLSCTX_REMOTE_SERVER.

E_INVALIDARG

dwClsCtx was not a valid value.

ppDatasource was a null pointer.

REGDB_E_CLASSNOTREG

The provider indicated by clsidProvider was not found.

dwClsCtx indicated a server type not supported by the provider.

Comments

None.