IRegisterProvider::SetURLMapping

OLE DB Programmer's Reference

Registers the ability of a provider binder object to process a particular URL scheme or scheme and prefix.

HRESULT SetURLMapping(    LPCOLESTR      pwszURL,    DB_DWRESERVE   dwReserved,    REFCLSID       rclsidProvider );

Parameters

pwszURL
[in]
The canonical URL scheme or scheme and prefix to be mapped.
dwReserved
[in]
Reserved for future use; providers should set this to zero.
rclsidProvider
[in]
A reference to the CLSID of the provider binder object, which is to be mapped to this URL scheme or scheme and prefix.

Return Code

S_OK
The method succeeded.
DB_E_RESOURCEEXISTS
The URL scheme or scheme and prefix combination was already mapped to a different provider binder object.
DB_SEC_E_PERMISSIONDENIED
The caller did not have permission to register this URL mapping.
E_FAIL
A provider-specific error occurred.
E_INVALIDARG
pwszURL was a null pointer or pointed to an invalid URL.

dwReserved was not 0.

Comments

Each URL scheme or scheme and prefix combination may be mapped to at most a single OLE DB provider. A URL scheme and prefix may be mapped to the same provider multiple times; however, the root binder should return S_OK on each call.

Note   "Provider Binder Objects" in Chapter 8, discusses case-sensitivity issues for URL-to-provider mapping.

IRegisterProvider::SetURLMapping uses InternetCrackUrl to validate URLs for mapping. In addition to the URLs accepted by InternetCrackUrl, IRegisterProvider::SetURLMapping accepts scheme-only URLs such as "http", "http:", "myscheme" and "myscheme:".

For more information about InternetCrackUrl, see the MSDN Library documentation.

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