Article ID: 252740 - Last Review: March 10, 2003 - Revision: 1.1 ACC2000: Query on a Table That Is Named with SQL Reserved Words Causes ErrorThis article was previously published under Q252740 Moderate: Requires basic macro, coding, and interoperability skills.
This article applies only to a Microsoft Access database (.mdb). On This PageSYMPTOMS
If you create a query based on a table that has a name beginning with the following Jet SQL reserved words
ALL (for example, "All YourName")
followed by a space before the rest of the table name, you may receive the following error message when you run the query:
DISTINCT (for example, "Distinct YourName") DISTINCTROW (for example, "Distinctrow YourName") TOP n (for example, "Top 5 YourName")
The Microsoft Jet database engine does not recognize 'YourName.*' as a valid field name or expression.
CAUSE
This behavior occurs because "ALL," "DISTINCT," "DISTINCTROW," and "TOP n" are Microsoft Jet SQL reserved words. Access interprets the SQL statement incorrectly, and does not initially recognize the reserved word as part of the table's name.
RESOLUTION
To resolve this problem, obtain Microsoft Office 2000 Service Release 1/1a (SR-1/SR-1a).
To obtain SR-1/SR-1a, click the article number below to view the article in the Microsoft Knowledge Base: 245025
(http://support.microsoft.com/kb/245025/EN-US/
)
OFF2000: How to Obtain and Install Microsoft Office 2000 Service Release 1/1a (SR-1/SR-1a)
To temporarily work around this problem, use one of the following methods.
Method 1: Save the Query in SQL ViewSave the query in SQL view before running it. To save the query in SQL view, follow these steps:
SELECT [All YourName].* FROM [All YourName];
where YourName is the rest of the name of the table that is used in the query.
Method 2: Rename the TableYou can also rename the table and omit the reserved word, or combine it with the next part of the table name (for example, "AllYourName" or "All_YourName").STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
This problem was corrected in Microsoft Office 2000 SR-1/SR-1a.
MORE INFORMATIONSteps to Reproduce Behavior
REFERENCESFor more information about Microsoft Jet SQL reserved words, click Microsoft Access Help on the Help menu, type sql reserved words in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
| Article Translations
|
Back to the top
