Uredi

Deli z drugimi prek


IAccessorImpl Class

Provides an implementation of the IAccessor interface.

Syntax

template <class T,
   class BindType = ATLBINDINGS,
   class BindingVector = CAtlMap <HACCESSOR hAccessor, BindType* pBindingsStructure>>
class ATL_NO_VTABLE IAccessorImpl : public IAccessorImplBase<BindType>

Parameters

T
Your rowset or command object class.

BindType
Storage unit for binding information. The default is the ATLBINDINGS structure (see atldb.h).

BindingVector
Storage unit for column information. The default is CAtlMap where the key element is an HACCESSOR value and the value element is a pointer to a BindType structure.

Requirements

Header: atldb.h

Members

Methods

Name Description
IAccessorImpl The constructor.

Interface Methods

Name Description
AddRefAccessor Adds a reference count to an existing accessor.
CreateAccessor Creates an accessor from a set of bindings.
GetBindings Returns the bindings in an accessor.
ReleaseAccessor Releases an accessor.

Remarks

This is mandatory on rowsets and commands. OLE DB requires providers to implement an HACCESSOR, which is a tag to an array of DBBINDING structures. HACCESSORs provided by IAccessorImpl are addresses of the BindType structures. By default, BindType is defined as an ATLBINDINGS in IAccessorImpl's template definition. BindType provides a mechanism used by IAccessorImpl to track the number of elements in its DBBINDING array as well as a reference count and accessor flags.

IAccessorImpl::IAccessorImpl

The constructor.

Syntax

IAccessorImpl();

IAccessorImpl::AddRefAccessor

Adds a reference count to an existing accessor.

Syntax

STDMETHOD(AddRefAccessor)(HACCESSOR hAccessor,
   DBREFCOUNT* pcRefCount);

Parameters

See IAccessor::AddRefAccessor in the OLE DB Programmer's Reference.

IAccessorImpl::CreateAccessor

Creates an accessor from a set of bindings.

Syntax

STDMETHOD(CreateAccessor)(DBACCESSORFLAGS dwAccessorFlags,
   DBCOUNTITEM cBindings,
   const DBBINDING rgBindings[],
   DBLENGTH cbRowSize,
   HACCESSOR* phAccessor,
   DBBINDSTATUS rgStatus[]);

Parameters

See IAccessor::CreateAccessor in the OLE DB Programmer's Reference.

IAccessorImpl::GetBindings

Returns the basic columns bindings from the consumer in an accessor.

Syntax

STDMETHOD(GetBindings)(HACCESSOR hAccessor,
   DBACCESSORFLAGS* pdwAccessorFlags,
   DBCOUNTITEM* pcBindings,
   DBBINDING** prgBindings);

Parameters

See IAccessor::GetBindings in the OLE DB Programmer's Reference.

IAccessorImpl::ReleaseAccessor

Releases an accessor.

Syntax

STDMETHOD(ReleaseAccessor)(HACCESSOR hAccessor,
   DBREFCOUNT* pcRefCount);

Parameters

See IAccessor::ReleaseAccessor in the OLE DB Programmer's Reference.

See also

OLE DB Provider Templates
OLE DB Provider Template Architecture