IDataInitialize::WriteStringToStorage

OLE DB Programmer's Reference

Writes a connection string.

HRESULT WriteStringToStorage(    LPCOLESTR      pwszFileName,    LPCOLESTR      pwszInitializationString,    DWORD          dwCreationDisposition);

Parameters

pwszFileName [in]
Name of the file.
pwszInitializationString [in]
Connection string to write.
dwCreationDisposition [in]
Flags controlling the write operation. Same as Win32 CreateFile dwCreationDisposition (CREATE_NEW, CREATE_ALWAYS, OPEN_EXISTING, OPEN_ALWAYS, TRUNCATE_EXISTING).

Return Code

S_OK
The method succeeded.
E_FAIL
A provider-specific error occurred.
E_INVALIDARG
pwszFileName was a null pointer.

pwszInitializationString was a null pointer.

dwCreationDisposition was an invalid value.

STG_E_FILENOTFOUND
dwCreationDisposition was OPEN_EXISTING, and the file indicated by pwszFileName was not found.

dwCreationDisposition was TRUNCATE_EXISTING, and the file indicated by pwszFileName was not found.

STG_E_FILEALREADYEXISTS
dwCreationDisposition was CREATE_NEW, and the file indicated by pwszFileName already exists.
STG_E_PATHNOTFOUND
The specified path name does not exist.
STG_E_ACCESSDENIED
dwCreationDisposition was OPEN_EXISTING or TRUNCATE_EXISTING, and the caller has insufficient permission to open the file.

dwCreationDisposition was OPEN_EXISTING or TRUNCATE_EXISTING, and another caller has the file open.

dwCreationDisposition was CREATE_NEW, and the caller has insufficient permission to write to the directory.

STG_E_INVALIDNAME
pwszFileName was an invalid file name.

Comments

The writing of the file will respect any file system flags on an existing file. For example, if the file is marked as read-only, the IDataInitialize::WriteStringToStorage method will fail and not overwrite the existing file.

1998-2001 Microsoft Corporation. All rights reserved.



Microsoft Ole Db 2.0 Programmer's Reference and Data Access SDK
Microsoft OLE DB 2.0 Programmers Reference and Data Access SDK (Microsoft Professional Editions)
ISBN: 0735605904
EAN: 2147483647
Year: 1998
Pages: 1083

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net