OLE DB Programmer's Reference |
Given a data source object, returns a connection string.
HRESULT GetInitializationString( IUnknown * pDataSource, boolean fIncludePassword, LPOLESTR * ppwszInitString);
Parameters
Return Code
ppwszInitString was a null pointer.
Comments
The string returned defines the connection and its current settings. This is done by returning a string version of all of the initialization properties set on the data source object.
The initialization properties listed in the following table are not included in the string returned by this method.
Initialization property | Why the property is not returned in the connection string |
---|---|
Asynchronous processing (DBPROP_INIT_ASYNCH) | When the user connects asynchronously, the way the consumer is using the connection information is more relevant than the connection itself. |
Window handle (DBPROP_INIT_HWND) | The value is good for only that specific instance. |
Prompt (DBPROP_INIT_PROMPT) | The calling application should have control over prompting. |
Timeout (DBPROP_INIT_TIMEOUT) | The property does not apply to the connection itself but to how the connection was established. |
General timeout (DBPROP_INIT_GENERALTIMEOUT) | The property does not apply to the connection itself but to how the connection was established. |
OLE DB services (OLEDB_SERVICES) | This property does not define the connection but rather specifies how the connection is going to be used. It is possible for multiple applications to use the same connection but with different sets of services. |
Note The password (DBPROP_AUTH_PASSWORD) property, if returned, is treated just like all other initialization properties. It is not encrypted or masked in any way.
1998-2001 Microsoft Corporation. All rights reserved.