Microsoft KB Archive/238243

= PRB: Method 'Open' of Object '_Recordset' Fails with Jet OLEDB Provider =

Article ID: 238243

Article Last Modified on 9/16/2003

-

APPLIES TO


 * Microsoft OLE DB Provider for Jet 4.0
 * Microsoft Data Access Components 2.5

-



This article was previously published under Q238243



SYMPTOMS
When you use the Jet OLE DB Provider version 4.0, an application may fail with the following error message:

Run-Time Error -2147467259 (80004005) Method 'Open' of Object '_Recordset' Failed.

This error occurs when trying to issue certain queries to the database.



CAUSE
In Jet 4.0 there is a new property called ExtendedAnsiSQL. The Jet OLEDB Provider version 4.0 turns on this new ANSI flag to enable new SQL syntax. Because the ExtendedAnsiSQL flag is turned on, Jet 4.0 uses the reserved words list defined by the SQL-92 standard. If the user tries to use a SQL-92 reserved word as an unquoted object name, an error is returned.



RESOLUTION
To work around this problem, try one of the following:
 * Change the name of the field in the database so that it does not use one of the reserved words define by the SQL-92 standard.


 * Place square brackets ([]) around the reserved word in the query. This allows the query to be executed even though the reserved word is in use. For example, "SELECT Usage From Table1" would become "SELECT [Usage] From Table1."



STATUS
This behavior is by design. The Microsoft Jet 4.0 OLEDB Provider relies on this setting and it cannot be disabled.



MORE INFORMATION
For a list of all the reserved words that Jet now enforces when this ANSI flag is turned on, refer to the following Microsoft Knowledge Base article:

248738 INFO: Microsoft Jet 4.0 Reserved Words

Keywords: kbdatabase kbprb kbmdacnosweep KB238243

-

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

© Microsoft Corporation. All rights reserved.