Unable to access DP4 from MFC Wizard created OLE DB application - A4000001 - 02 Aug 2000

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:

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).