Microsoft Knowledge Base Email Alertz

(255996) - OLE DB Services are used in a variety of ways, and the error that is returned by this bug depends on the situation. This article describes some of the possible uses and the errors that may result. on how to load the OLE DB Services 223333...

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: 255996 - Last Review: December 5, 2003 - Revision: 3.1

FIX: OLE DB Services Are Not Loaded When Execute() Is Called from ICommandText

This article was previously published under Q255996

SYMPTOMS

OLE DB Services are used in a variety of ways, and the error that is returned by this bug depends on the situation. This article describes some of the possible uses and the errors that may result. For additional information on how to load the OLE DB Services, click the article number below to view the article in the Microsoft Knowledge Base:
223333  (http://kbalertz.com/Feedback.aspx?kbNumber=223333/EN-US/ ) OleDbOrc.exe: Using the OLE DB Cursor Engine Service to Provide Updatability for OLE DB Providers

Using OLE DB Services to Obtain an Updatable Rowset with Providers That Do Not Support IRowsetChange Directly

Some providers do not implement the optional IRowsetChange interface. To modify data, the consumer can either use the SQL statements INSERT, UPDATE, and DELETE in conjunction with the ICommand::Execute or ICommandText::Execute methods, or load OLE DB Services to obtain a client-side, updatable cursor.

When OLE DB Services are loaded, the consumer can request the IRowsetChange interface with providers that do not natively support it. The Microsoft OLE DB Provider for Oracle is an example of a provider that does not support the IRowsetChange interface natively. However, if the consumer calls the ICommandText::Execute method, the OLE DB Services may not be loaded. When the consumer then queries for the IRowsetChange interface, the following error is returned:
hr = -2147467262, 0x80004002 or E_NOINTERFACE

Using OLE DB Services to Obtain a Scrollable or Updatable Rowset When the Rowset is Returned by a Stored Procedure

The Microsoft OLE DB Provider for SQL Server cannot return a scrollable or updatable rowset when the rowset is returned by a stored procedure that contains anything other than a single SELECT statement. For additional information on this problem and its resolution, see the following article:
241639  (http://kbalertz.com/Feedback.aspx?kbNumber=241639/EN-US/ ) PRB: Errors Occurred Error When Calling Stored Procedure with More than a SELECT Statement
The consumer can load OLE DB Services in order to obtain a scrollable or updatable rowset. However, if the consumer calls the ICommandText::Execute method, the OLE DB Services may not be loaded, and the call may fail with the following error:
hr = -2147217887, 0x80040e21 , DB_E_ERRORSOCCURRED
This error is returned because the provider attempts to open a server-side cursor on the stored procedure call.

CAUSE

The OLE DB Services are not loaded if ICommandText::Execute is called without requesting the ICommand interface first.

RESOLUTION

To resolve this problem, upgrade to Microsoft Data Access Components (MDAC) 2.5.

If you are using a version of MDAC earlier than version 2.5, there are two ways to work around the problem:
  • Request ICommand and call Execute from that ICommand interface. -or-

  • Obtain ICommandText from an ICommand interface pointer, and then call ICommandText::Execute. For example, request ICommand, rather than ICommandText, from IDBCreateCommand::CreateCommand, and then use the QueryInterface method to obtain that ICommand pointer for ICommandText.
Once the Execute is performed, the OLE DB Services are loaded.

NOTE: If OLE DB Services are loaded, Msadce.dll is loaded from C:\Program Files\Common Files\System\msadc\Msadce.dll by default. If Msadce.dll is not loaded when ICommand::Execute or ICommandText::Execute is called, OLE DB Services were not loaded.

STATUS

This problem was corrected in Microsoft Data Access Components version 2.5.

REFERENCES

223333  (http://kbalertz.com/Feedback.aspx?kbNumber=223333/EN-US/ ) OleDbOrc.exe: Using the OLE DB Cursor Engine Service to Provide Updatability for OLE DB Providers
241639  (http://kbalertz.com/Feedback.aspx?kbNumber=241639/EN-US/ ) PRB: Errors Occurred Error When Calling Stored Procedure with More than a SELECT Statement

APPLIES TO
  • Microsoft Data Access Components 2.0
  • Microsoft Data Access Components 2.1
  • Microsoft OLE DB 2.0
  • Microsoft OLE DB 2.1
Keywords: 
kbbug kbfix kbmdac250fix kboledb250fix KB255996
       

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