Partager via


IRowsetInfo::GetSpecification

Returns an interface pointer on the object (command or session) that created this rowset.

Syntax

HRESULT GetSpecification (
   REFIID        riid,
   IUnknown    **ppSpecification);

Parameters

  • riid
    [in] The IID of the interface on which to return a pointer.

  • ppSpecification
    [out] A pointer to memory in which to return the interface pointer. If the provider does not have an object that created the rowset, it sets *ppSpecification to a null pointer and returns S_FALSE. If IRowsetInfo::GetSpecification fails, it must attempt to set *ppSpecification to a null pointer.

Return Code

  • S_OK
    The method succeeded.

  • S_FALSE
    The provider does not have an object that created the rowset.

  • E_FAIL
    A provider-specific error occurred.

  • E_INVALIDARG
    ppSpecification was a null pointer.

  • E_NOINTERFACE
    The object that created this rowset did not support the interface specified in riid.

  • E_UNEXPECTED
    ITransaction::Commit or ITransaction::Abort was called, and the object is in a zombie state.

  • DB_E_NOTREENTRANT
    The provider called a method from IRowsetNotify in the consumer that had not yet returned, and the provider does not support reentrancy in this method.

Comments

This method makes no logical change to the state of the current rowset.

IRowsetInfo::GetSpecification returns an interface pointer on the object that created the rowset. If a rowset was obtained from a multiple results object, IRowsetInfo::GetSpecification returns an interface pointer on the command or session object that created the multiple results object. If the rowset was created by ICommand::Execute, this object is a command. If the rowset was created by IOpenRowset::OpenRowset, this object is a session.

If the object is not a command, it must specify the contents of the rowset. That is, it must expose interfaces that can be used to modify the contents of the rowset before the rowset is created, or it must be used to gain additional information about the rowset. If the object cannot expose such interfaces, IRowsetInfo::GetSpecification should return a null pointer in *ppSpecification. In a simple provider, such as a provider that creates a rowset over a fixed set of data, there might not be an object that created the rowset; in this case, IRowsetInfo::GetSpecification returns a null pointer in *ppSpecification.

If the rowset is the COLUMNS rowset (as returned by IColumnsRowset::GetColumnRowset), IRowsetInfo::GetSpecification returns an interface on the rowset that implemented IColumnsRowset, and not the command or session that is the parent of this rowset.

See Also

Reference

ICommand::GetDBSession

IGetDataSource::GetDataSource