If you create an application to access a DP4 database using OLE DB via an MFC Wizard, the application does not work, and errors are returned by the various APIs.
The cause of this problem is that the MFC Wizard generates incorrect code for DP4. The latest DP4 ODBC drivers work with OLE DB itself. The code generated by MFC is incorrect for two reasons:
Completely invalid SQL statements are generated for accessing the database;
The MFC application accesses the fields in a table by "column number" rather than by name. However the column numbers it uses do not match the order of the columns returned.
We have not yet determined the cause of this problem with MFC. It may be because the Wizard relies on extended ODBC functionality we do not provide, or it may just be a bug in the Wizard (the first problem is certainly a bug as there is no excuse for generating invalid SQL). Perhaps it is making invalid assumptions about the order of columns based on some other property it is querying.
The workaround for this problem is not to use the Wizard, but to write the code to access the database manually instead (or at least check and correct as necessary the Wizard created code).