Selecting and Manipulating Records

HomeOverviewHow Do IFAQSampleTutorialODBC Driver List

Normally when you select records from a data source using an SQL SELECT statement, you get a “result set” — a set of records from a table or a query. With the database classes, you use a “recordset” object to select and access the result set. This is an object of an application-specific class that you derive from class CRecordset. When you define a recordset class, you specify the data source to associate it with, the table to use, and the columns of the table. Either ClassWizard or AppWizard creates a class with a connection to a specific data source. The wizards write the GetDefaultSQL member function of class CRecordset to return the table name. For more information on using the wizards to create recordset classes, see the articles Overview: Creating a Program That Supports a Database and ClassWizard: Database Support.

Using a CRecordset object at run time, you can:

When you finish using the recordset object, you close and destroy it. For more information about recordsets, see the article Recordset (ODBC).