Microsoft Knowledge Base Email Alertz

(238243) - 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...

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 238243 - Last Review: September 16, 2003 - Revision: 2.1

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

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  (http://kbalertz.com/Feedback.aspx?kbNumber=248738/EN-US/ ) INFO: Microsoft Jet 4.0 Reserved Words

APPLIES TO
  • Microsoft OLE DB Provider for Jet 4.0
  • Microsoft Data Access Components 2.5
Keywords: 
kbdatabase kbmdacnosweep kbprb KB238243
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

kunal Report As Irrelevant  
Written: 6/9/2004 4:07 PM
Its very good. this is my first click on this page but I found this is much better then othes.

Rob Report As Irrelevant  
Written: 2/9/2005 6:19 AM
Thanks for posting this. I was using 'referenced' table names and found that adding squre brackets[tablename].[field] solved the problem.