Releasing Rowsets

OLE DB Programmer's Reference

When the consumer is done with the rowset, it must release it as follows:

  • If the consumer has created any accessors on the rowset, it must release them by calling IAccessor::ReleaseAccessor on each accessor individually.
  • To release the rowset object itself, the consumer must call IUnknown::Release on each interface pointer retrieved on the rowset. When the rowset is released, it forces the release of any remaining row handles the consumer holds. Such handle objects are subordinate to the rowset and cannot cause it to linger beyond the point where all the interfaces for the rowset have been released. The rowset is responsible for cleaning up all such subordinate objects.
Note   If the consumer obtained the rowset by executing a command containing output parameters and the provider populates output parameters when the rowset is released (that is, the value of DBPROP_OUTPUTPARAMETERAVAILABILITY is DBPROP_OA_ATROWRELEASE), the consumer must ensure that memory allocated for the output parameters that were bound at ICommand::Execute time must still be valid when the rowset is released. Not doing so is a serious programming error that can cause abnormal termination.

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