IRowsetInfo::GetSpecification

OLE DB Programmer's Reference

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

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

ICommand::GetDBSession | IGetDataSource::GetDataSource

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