Microsoft KB Archive/287417

= ACC2002: Error with ANSI-92 Reserved Words When SQL Server Compatibility Syntax (ANSI 92) Is Enabled =

Article ID: 287417

Article Last Modified on 9/27/2003

-

APPLIES TO


 * Microsoft Access 2002 Standard Edition

-



This article was previously published under Q287417



Advanced: Requires expert coding, interoperability, and multiuser skills.

This article applies only to a Microsoft Access database (.mdb).



SYMPTOMS
ANSI-92 reserved words generate the following error in queries when the check boxes under SQL Server Compatibility Syntax (ANSI 92) are selected.

Reserved Error (-1001); There is no message for this error.



RESOLUTION
To avoid the error message, use one of the following workarounds.

Workaround 1


 * 1) View the query in Design view.
 * 2) Place brackets ([]) around the ANSI-92 reserved words.
 * 3) Save the query.

Workaround 2

When you design the tables in the database, be careful not to use ANSI-92 reserved words. If a table has a field already defined, consider changing the field name.

Workaround 3

Consider disabling the SQL Server Compatibility Syntax (ANSI 92) option for the database. To disable the option:
 * 1) On the Tools menu, click Options.
 * 2) Click the Tables/Queries tab.
 * 3) Click to clear the check boxes under SQL Server Compatibility Syntax (ANSI 92).



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
The following is a list of ANSI 92 reserved words that are known to generate the error mentioned in the &quot;Symptoms&quot; section of this article.

Steps to Reproduce the Behavior
 Start Microsoft Access, and then open the sample database Northwinds.mdb.  Create the following table:   Table: Table1 Field Name: ID  Data Type: Autonumber Indexed: Yes (No Duplicates)

Field Name: Language Data Type: Text

Field Name: Location Date Type: Text

Table Properties: Table1 PrimaryKey: ID                    Save the new table as Table1, and then add one record to the table. Close the Table1 table. On the Tools menu, click Options.</li> Click the Tables/Queries tab.</li> Under SQL Server Compatibility Syntax (ANSI 92), click to select the This database check box.</li> Create a new query in Design view.</li> Close the Add Table dialog box without making any selection.</li> On the View menu, click SQL View.</li> In the SQL window, type the following SQL statement:

SELECT Language FROM Table1

</li> Try to run the query.

Note that you receive the error message that is mentioned in the &quot;Symptoms&quot; section of this article.</li></ol>

Additional query words: pra Reserved Words prb

Keywords: kberrmsg kbprb KB287417

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.