Commands and tables allow you to access rowsets; that is, open rowsets, execute commands, and bind columns. The and classes instantiate the command and table objects, respectively. These classes derive from as shown in the following figure.
In the previous table, TAccessor can be any accessor type listed in Accessor Types. TRowset can be any rowset type listed in Rowset Types. TMultiple specifies the result type (a single or multiple result set).
The lets you specify whether you want a command or table object.
For data sources without commands, you can use the CTable class. You generally use it for simple rowsets that specify no parameters and require no multiple results. This simple class opens a table on a data source using a table name that you specify.
For data sources that support commands, you can use the CCommand class instead. To execute a command, call on this class. As an alternative, you can call Prepare to prepare a command that you want to execute more than once.
CCommand has three template arguments: an accessor type, a rowset type, and a result type (CNoMultipleResults, by default, or CMultipleResults). If you specify CMultipleResults, the CCommand class supports the IMultipleResults interface and handles multiple rowsets. The sample shows how to handle the multiple results.