OLE DB Programmer's Reference |
Loads a connection string.
HRESULT LoadStringFromStorage( LPCOLESTR pwszFileName, LPCOLESTR * ppwszInitializationString);
Parameters
Return Code
ppwszInitializationString was a null pointer.
The file is already open and locked for writing.
Comments
The ppwszInitializationString retrieved using this method will have any leading or trailing spaces trimmed from it. Hence, the string might not be exactly the same one as written using the IDataInitialize::WriteStringToStorage method. For example, passing in the string
" Provider=MSDASQL.1; User ID = sa "
will be returned as
"Provider=MSDASQL.1; User ID = sa"
When using .udl files to establish a connection, add "Udl Pooling" to the registry under the "SOFTWARE\Microsoft\DataAccess" key to improve performance. A Cache Size value greater than 0 (Cache Size=1) will enable the feature. A value of 100 is recommended.
1998-2001 Microsoft Corporation. All rights reserved.