Skip to content

Latest commit

 

History

History
119 lines (75 loc) · 3.23 KB

File metadata and controls

119 lines (75 loc) · 3.23 KB
description Learn more about: CEnumerator Class
title CEnumerator Class
ms.date 11/04/2016
f1_keywords
CEnumerator
CEnumerator::Find
ATL::CEnumerator::Find
ATL.CEnumerator.Find
CEnumerator.Find
GetMoniker
CEnumerator.GetMoniker
CEnumerator::GetMoniker
ATL.CEnumerator.GetMoniker
ATL::CEnumerator::GetMoniker
ATL.CEnumerator.Open
CEnumerator::Open
ATL::CEnumerator::Open
CEnumerator.Open
helpviewer_keywords
CEnumerator class
Find method
GetMoniker method
Open method
ms.assetid 25805f1b-26e3-402f-af83-1b5fe5ddebf7

CEnumerator Class

Uses an OLE DB enumerator object, which exposes the ISourcesRowset interface to return a rowset describing all data sources and enumerators.

Syntax

class CEnumerator :
   public CAccessorRowset< CAccessor <CEnumeratorAccessor >>

Requirements

Header: atldbcli.h

Members

Methods

Name Description
Find Searches through available providers (data sources) looking for one with the specified name.
GetMoniker Retrieves the IMoniker interface for the current record.
Open Opens the enumerator.

Remarks

You can retrieve the ISourcesRowset data indirectly from this class.

CEnumerator::Find

Looks for a specified name among available providers.

Syntax

bool Find(TCHAR* szSearchName) throw();

Parameters

szSearchName
[in] The name to search for.

Return Value

true if the name was found. Otherwise, false.

Remarks

This name maps to the SOURCES_NAME member of the ISourcesRowset interface.

CEnumerator::GetMoniker

Parses the display name to extract the component of the string that can be converted into a moniker.

Syntax

HRESULT GetMoniker(LPMONIKER* ppMoniker) const throw();

HRESULT GetMoniker(LPMONIKER* ppMoniker,
   LPCTSTR lpszDisplayName) const throw();

Parameters

ppMoniker
[out] The moniker parsed from the display name (CEnumeratorAccessor::m_szParseName) of the current row.

lpszDisplayName
[in] The display name to parse.

Return Value

A standard HRESULT.

CEnumerator::Open

Binds the moniker for the enumerator, if one is specified, then retrieves the rowset for the enumerator by calling ISourcesRowset::GetSourcesRowset.

Syntax

HRESULT Open(LPMONIKER pMoniker) throw();

HRESULT Open(const CLSID* pClsid = & CLSID_OLEDB_ENUMERATOR) throw();

HRESULT Open(const CEnumerator& enumerator) throw();

Parameters

pMoniker
[in] A pointer to a moniker for an enumerator.

pClsid
[in] A pointer to the CLSID of an enumerator.

enumerator
[in] A reference to an enumerator.

Return Value

A standard HRESULT.

See also

DBViewer
OLE DB Consumer Templates
OLE DB Consumer Templates Reference