IAccessor::ReleaseAccessor

OLE DB Programmer's Reference

Releases an accessor.

HRESULT ReleaseAccessor (    HACCESSOR   hAccessor,    DBREFCOUNT *pcRefCount);

Parameters

hAccessor
[in]
The handle of the accessor to release.
pcRefCount
[out]
A pointer to memory in which to return the remaining reference count of the accessor handle. If pcRefCount is a null pointer, no reference count is returned.

Return Code

S_OK
The method succeeded.
E_FAIL
A provider-specific error occurred.
DB_E_BADACCESSORHANDLE
hAccessor was invalid.
DB_E_NOTREENTRANT
The provider called a method from IRowsetNofity in the consumer that had not yet returned, and the provider does not support reentrancy in this method.

Comments

IAccessor::ReleaseAccessor decrements the reference count of the accessor. If the reference count reaches zero, it releases the accessor and all resources used by the accessor. After an accessor is released, methods called with the handle to that accessor return DB_E_BADACCESSORHANDLE.

On rowsets, accessors are read-only and can be shared among threads in a free-threaded style without synchronization. The consumer must call IAccessor::ReleaseAccessor to decrement the reference count on an accessor that has been passed to a thread and is no longer needed by that thread.

This method can be called while the rowset is in a zombie state to enable the consumer to clean up after a transaction has been committed or aborted.

See Also

IAccessor::AddRefAccessor | IAccessor::CreateAccessor

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