JavaScript EditorDhtml editor     Free javascript download 

Main Page

You can determine data types on a rowset at compile time or at run time.

If you need to determine data types at compile time, use a static accessor (such as CAccessor). You can determine the data types manually or by using the ATL OLE DB Consumer Wizard.

If you need to determine the data types at run time, use a dynamic (CDynamicAccessor or its children) or manual accessor (CManualAccessor). In these cases, you can call GetColumnInfo on the rowset to return the column binding information, from which you can determine types.

The following table lists the types of accessors provided in the consumer templates. Each accessor has advantages and disadvantages. Depending on your situation, one accessor type should suit your needs.

Accessor class Binding Parameter Comment


Create a user record with COLUMN_ENTRY macros. The macros bind a data member in that record to the accessor. When the rowset is created, columns cannot be unbound.

Yes, by using a PARAM_MAP macro entry. Once bound, parameters cannot be unbound.

Fastest accessor because of small amount of code.




Useful if you do not know the type of data in a rowset.


Automatic, but can be overridden.

Yes, if the provider supports ICommandWithParameters. Parameters bound automatically.

Slower than CDynamicAccessor but useful for calling generic stored procedures.




Retrieves data accessed from the data store as string data.


Manual using AddBindEntry.

Manually using AddParameterEntry.

Very fast; parameters and columns bound only once. You determine the type of data to use. (See DBVIEWER sample for an example.) Requires more code than CDynamicAccessor or CAccessor. It is more like calling OLE DB directly.




Retrieves data accessed from the data store as string data and formats it as XML-tagged data.

Expand imageSee Also

JavaScript EditorDhtml editor     Free javascript download