ROWINFO.CPP

//-------------------------------------------------------------------- 
// Microsoft OLE DB Sample Provider
// (C) Copyright 1994 - 1996 Microsoft Corporation. All Rights Reserved.
//
// @doc
//
// @module ROWINFO.CPP | IRowsetInfo interface implementation
//

// Includes ------------------------------------------------------------------

#include "headers.h"

// Code ----------------------------------------------------------------------


// IRowsetInfo specific methods

// CImpIRowsetInfo::GetReferencedRowset ----------------------------------------------------
//
// @mfunc Returns an interface pointer to the rowset to which the bookmark
// applies
//
// @rdesc HRESULT
// @flag DB_E_NOTAREFERENCECOLUMN| This rowset does not support bookmarks
//
STDMETHODIMP CImpIRowsetInfo::GetReferencedRowset
(
ULONGiOrdinal,//@parm IN| Bookmark Column
REFIIDriid,//@parm IN| ID of the interface pointer to return
IUnknown **ppReferencedRowset//@parm OUT | IRowset Interface Pointer
)
{
// Since we don't support bookmarks, this will alway return
// an error
return ResultFromScode( DB_E_NOTAREFERENCECOLUMN );
}



// CImpIRowsetInfo::GetProperties ----------------------------------------------------
//
// @mfunc Returns current settings of all properties supported by the rowset
//
// @rdesc HRESULT
// @flag S_OK | The method succeeded
// @flag E_INVALIDARG | pcProperties or prgProperties was NULL
// @flag E_OUTOFMEMORY | Out of memory
//
STDMETHODIMP CImpIRowsetInfo::GetProperties
(
const ULONG cPropertySets,//@parm IN | # of property sets
const DBPROPIDSETrgPropertySets[],//@parm IN | Array of DBPROPIDSET
ULONG* pcProperties,//@parm OUT | count of properties returned
DBPROPSET**prgProperties//@parm OUT | property information returned
)
{
assert( m_pObj );
assert( m_pObj->m_pUtilProp );

// just pass this call on to the utility object that manages our properties
return m_pObj->m_pUtilProp->GetProperties( cPropertySets, rgPropertySets,
pcProperties, prgProperties );
}



// CImpIRowsetInfo::GetSpecification ---------------------------------------
//
// @mfunc Returns the interface pointer of the object that created the rowset
//
// @rdesc HRESULT
// @flag S_OK | Method Succeeded
// @flag E_INVALIDARG | Invalid parameters were specified
//
STDMETHODIMP CImpIRowsetInfo::GetSpecification
(
REFIID riid, //@parm IN | Interface ID of the interface being queried for.
IUnknown **ppSpecification //@parm OUT | Pointer to interface that instantiated this object
)
{
HRESULT hr=S_OK;

if (NULL == ppSpecification)
return ResultFromScode( E_INVALIDARG );

// we do not have an interface pointer on the object that created this rowset, yet.
*ppSpecification = NULL;

if (m_pObj->m_pCreator)
hr = m_pObj->m_pCreator->QueryInterface (riid,(void**)ppSpecification);

return hr;
}