BUG: Syntax Error When Using Qualified Table Name with QuotesLast reviewed: September 9, 1996Article ID: Q124319 |
The information in this article applies to:
BUG# QJET: 1800 (2.00.2317)
SYMPTOMSWhen using table names qualified with the current qualifier and using identifier quote character to enclose the current qualifier and the table name, you receive a syntax error. This happens with dBASE, Paradox, Microsoft FoxPro, Btrieve, Microsoft Excel, and Text Open Database Connectivity (ODBC) drivers. It does NOT happen with the Microsoft Access driver. For example, in case of dBase driver, if the values returned by SQLGetConnectOption and SQLGetInfo are as shown:
SQLGetConnectOption(hdbc,SQL_CURRENT_QUALIFIER,pvParam) Returns "C:\Database" SQLGetInfo(hdbc, SQL_IDENTIFIER_QUOTE_CHAR, rgbInfoValue,cbInfoValueMax) Returns "`" SQLGetInfo(hdbc, SQL_QUALIFIER_NAME_SEPARATOR,rgbInfoValue,cbInfoValueMax) Returns "\"Then you let a table called testtable exist in the data source. The queries of the form below will receive syntax error SQLState=37000, szErrorMsg=,
Syntax error in FROM clausewhen executed using SQLExecDirect or SQLExecute calls.
Select * from 'C:\Database'\'testtable' delete from 'C:\Database'\'testtable' Update 'C:\Database'\'testtable' set <colname>=<new value>If you do not use the quote character around the qualifier and the table, these queries work fine.
WORKAROUNDIf you do not use the quote character around the qualifier and the table name, the queries work correctly and do not return errors. Alternately, instead of using the backward slash (\) as a separator, if you use a period (.), which is the separator in the Microsoft Access ODBC driver, the queries work fine with the qualifier and table name enclosed in the quote character.
STATUSMicrosoft has confirmed this to be a problem in ODBC DeskTop Database Drivers Pack version 2.00.2317. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
|
Additional reference words: 2.00.2317 ODBC MFC Access Windows NT
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |