Constructs a CRecordset object.

   CDatabase* pDatabase = NULL



Contains a pointer to a CDatabase object or the value NULL. If not NULL and the CDatabase object's Open member function has not been called to connect it to the data source, the recordset attempts to open it for you during its own Open call. If you pass NULL, a CDatabase object is constructed and connected for you using the data source information you specified when you derived your recordset class with ClassWizard.

You can either use CRecordset directly or derive an application-specific class from CRecordset. You can use ClassWizard to derive your recordset classes.


A derived class must supply its own constructor. In the constructor of your derived class, call the constructor CRecordset::CRecordset, passing the appropriate parameters along to it.

Pass NULL to your recordset constructor to have a CDatabase object constructed and connected for you automatically. This is a useful shorthand that does not require you to construct and connect a CDatabase object prior to constructing your recordset.

For more information, see the article Recordset: Declaring a Class for a Table (ODBC).

Community Additions