If you use AppWizard to create a DAO database application, AppWizard generates a class derived from CDaoRecordset with a DoFieldExchange function that binds data members to the columns in a specific database table. For a dyna-mic recordset class, however, you need to determine the column names and data types at runtime. The EX31A example shows how to do this with ODBC.
With DAO, the procedure is similar. You simply construct a CDaoRecordset object and call the GetFieldValue member function, which returns a VARIANT representing the column value. Other member functions tell you the number of columns in the table and the name, type, and width of each column.
If a field VARIANT contains a BSTR, assume the string contains 8-bit characters. This is an exception to the rule that all BSTRs contain wide characters.