There are four main types of accessors in the consumer templates. Each accessor has its own advantages and disadvantages. Depending upon your situation one accessor type should suit your needs.
CAccessor
Binding | Parameters | Comments |
Create a user record with COLUMN_ENTRY macros. The macros bind a data member in that record to the accessor. Once 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. |
CDynamicAccessor
Binding | Parameters | Comments |
Automatic. | No. | Useful if you do not know the type of data in a rowset. |
CDynamicParameterAccessor
Binding | Parameters | Comments |
Automatic, but can be overridden. | Yes, if the provider supports ICommandWithParameters. Parameters bound automatically. | Slower than CDynamicAccessor but useful for calling generic stored procedures. |
CManualAccessor
Binding | Parameters | Comments |
Manual using AddBindEntry | Manually using AddParameterEntry. | Very fast since parameters and columns are bound only once. You determine the type of data you want to deal with. (See the DBVIEWER sample as an example.) Requires more code than CDynamicAccessor or CAccessor. Code tends to be more like calling OLE DB directly. |