Share via


IDBInitialize::Uninitialize

Returns the data source object or enumerator to an uninitialized state.

Syntax

HRESULT Uninitialize();

Parameters

None.

Return Code

  • S_OK
    The method succeeded.

  • E_FAIL
    A provider-specific error occurred.

  • E_UNEXPECTED
    The data source object is in the process of being initialized asynchronously. To cancel asynchronous initialization, call IDBAsynchStatus::Abort.

  • DB_E_OBJECTOPEN
    There were open sessions, commands, or rowsets on the data source object.

  • DB_S_ASYNCHRONOUS
    The method will be completed asynchronously.

Comments

The consumer is not required to uninitialize a data source object or enumerator before releasing it but may use this method to release the state associated with the data source object or enumerator so that it can be reinitialized with IDBInitialize::Initialize or a new state loaded on a data source object, such as with IPersistFile::Load.

It is an error to call IDBInitialize::Uninitialize when there are open sessions, commands, or rowsets on the data source object; that is, the consumer must release all interface pointers on all sessions, commands, and rowsets on the data source object before calling IDBInitialize::Uninitialize. It is not an error to call IDBInitialize::Uninitialize if IDBInitialize::Initialize has not been called.

Notes

After IDBInitialize::Uninitialize is called the status of the asynchronously executing operation is found using IDBAsynchStatus.

For information about what the consumer can and cannot do with a data source object or enumerator that is uninitialized, see Data Source Object States and Enumerator States.

See Also

Reference

IDBInitialize::Initialize