MSQuery Err: "Syntax Error . . . " Using ODBC Driver |
In Microsoft Query, if you have a table with the name "Database" or "Table," and you try to add a field from the table to the Data pane, you may receive either of the following error messages:
-or--Syntax error
You may also receive one of the following error messages when inserting, updating or deleting records in a database table:-Syntax error in FROM clause
-or--Syntax error in INSERT statement.
-Syntax error in UPDATE statement.
Microsoft Query creates a Structured Query Language (SQL) statement as you
add, delete, or modify any criteria or fields in a query. "The syntax rules
for SQL prohibit the use of reserved SQL words, such as "database" or
"table", as table names. Also, reserved SQL words, such as "date" or
"integer", cannot be used as field names."
This problem will occur under the following circumstances:
To keep from receiving this error message, use either of the following
methods.
Method 1: Name the range something other than "Database" or "Table."
Method 2: If you are accessing data from a Microsoft Excel 5.0 workbook
that contains a global range named "Database" or "Table," define
it as a local range name, such as "Sheet1!Database." Note that
making the name a local one will cause the table name to be
displayed with the sheet name and then the range name:
Sheet1!Database.
Method 3: Add brackets ([) around the words "Database" or "Table." For
example, to select all records from a table called Database,
follow these steps:
SELECT * FROM [Database] Additional query words: 2.00 MSQuery
Keywords : xlquery
Version : WINDOWS:1.0,2.0
Platform : WINDOWS
Issue type :
Technology :
|
Last Reviewed: October 1, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |