The information in this article applies to:
SYMPTOMSIn the debug version of your MFC DAO application, you may get an assertion in the Daocore.cpp file, line 4854, followed by one of the following error messages:
-or- This problem happens only if you open a dynaset or snapshot type of CDaoRecordset object and its SQL select statement has a space before it. CAUSEThe source of this problem is in the MFC CDaoRecordset::Open function located in Daocore.cpp. This function tries to sense the nature of the SQL statement passed to it by scanning for the keyword "SELECT" at line 3345 in Daocore.cpp. If you place a space before the select statement, this code doesn't successfully predict the type of SQL statement, and therefore fails. RESOLUTIONRemove the preceding space from your SQL select statement. STATUSThis behavior is by design. MORE INFORMATIONTo reproduce the problem, create a simple dialog-based MFC application. Add a command button to the dialog box and in the handler for this button, add the following code:
Compile and run this application. By clicking the created button, you will see an assertion followed by one of the error messages in the Summary section. For an AppWizard-generated CDaoRecordset-derived class, the error message is:
For a nonderived CDaoRecordset class, the error is:
Additional query words:
Keywords : kbDAO kbDatabase kbMFC kbVC kbVC600 kbGrpVCDB kbDSupport |
Last Reviewed: October 14, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |