You receive a "Syntax Error in From Clause" error message in the debug version of a MFC DAO application (238436)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
This article was previously published under Q238436 SYMPTOMS In 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: Syntax Error in From Clause
The SELECT statement includes a reserved
word or an argument name that is misspelled or missing, or the punctuation is
incorrect. 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.
CAUSE The 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. RESOLUTION Remove the preceding space from your SQL select statement.
STATUS This behavior is by design.
Modification Type: | Major | Last Reviewed: | 9/7/2005 |
---|
Keywords: | kbDatabase kbprb KB238436 kbAudDeveloper |
---|
|