Loads a connection string.
HRESULT LoadStringFromStorage(
LPCOLESTR pwszFileName,
LPCOLESTR * ppwszInitializationString);
Parameters
pwszFileName [in]
Name of the file.
ppwszInitializationString [out]
On exit, *ppwszInitializationString will contain the connection string.
Return Code
S_OK
The method succeeded.
E_FAIL
A provider-specific error occurred.
E_INVALIDARG
pwszFileName was a null pointer.
ppwszInitializationString was a null pointer.
STG_E_FILENOTFOUND
The file indicated by pwszFileName was not found.
STG_E_ACCESSDENIED
The caller has insufficient permission to open the file.
The file is already open and locked for writing.
STG_E_INVALIDNAME
pwszFileName was an invalid file name.
STG_E_INVALIDHEADER
pwszFileName was a file that is not a UDL format file.
Comments
The ppwszInitializationString retrieved using this method will have any leading or trailing spaces trimmed from it. Hence, the string may not be exactly the same one as written using the WriteStringFromStorage method. For example, passing in the string " Provider=MSDASQL.1; User ID = sa "
will be returned as "Provider=MSDASQL.1; User ID = sa"