Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


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.

↑ Back to the top


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.

↑ Back to the top


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."

↑ Back to the top


Status

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

↑ Back to the top


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

↑ Back to the top


Keywords: kb, kbprb, kbmdacnosweep, kbdsupport, kbdatabase, kbbillprodsweep

↑ Back to the top

Article Info
Article ID : 238243
Revision : 5
Created on : 8/20/2020
Published on : 8/20/2020
Exists online : False
Views : 159