You receive a "Syntax error in FROM clause" error message when you use the AppWizard to create a CRecordset class by using the ODBC Text Driver in Visual C++ (177947)
The information in this article applies to:
- Microsoft Data Access Components 2.5, when used with:
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 5.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 Q177947 SYMPTOMS When you use the AppWizard to create a CRecordset class
using the ODBC Text Driver, your project will compile. However, when you try to
open the recordset, you will get the following error message:
Syntax error in FROM clause. CAUSE The AppWizard incorrectly parses the table as
[Table].[txt], instead of as [Table#txt]. RESOLUTION In the CTextDriverSet.cpp implementation file, find the
CTextDriverSet::GetDefaultSQL() function and change the return value from
return _T("[Table].[txt]");
to the following:
return _T("[Table#txt]");
Here is the function before the changes:
CString CTextDriverSet::GetDefaultSQL()
{
return _T("[Table].[txt]");
}
Here is the function after the changes:
CString CTextDriverSet::GetDefaultSQL()
{
return _T("[Table#txt]");
}
STATUS Microsoft is researching this problem and will post new
information here in the Microsoft Knowledge Base as it becomes available.
Modification Type: | Major | Last Reviewed: | 6/2/2005 |
---|
Keywords: | kberrmsg kbtshoot kbDatabase kbMDACNoSweep kbprb KB177947 kbAudDeveloper |
---|
|