Microsoft Knowledge Base Email Alertz

(286213) - If you open a session using the SQLOLEDB OLEDB provider specifying DBPROP_MULTIPLECONNECTIONS = VARIANT_FALSE, and then attempt to run multiple parameterized selects (using server cursors, which allow multiple active statements per session), the...

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: 286213 - Last Review: November 3, 2003 - Revision: 2.2

PRB: Second Parameterized Command Fails with Server Cursor

This article was previously published under Q286213

SYMPTOMS

If you open a session using the SQLOLEDB OLEDB provider specifying DBPROP_MULTIPLECONNECTIONS = VARIANT_FALSE, and then attempt to run multiple parameterized selects (using server cursors, which allow multiple active statements per session), the second and subsequent commands may fail with an "Object is open" error.

STATUS

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

MORE INFORMATION

When opening a session using the SQLOLEDB OLEDB provider, you can set the DBPROP_MULTIPLECONNECTIONS property to VARIANT_FALSE to disable the provider from making additional connections internally. Therefore, with DBPROP_MULTIPLECONNECTIONS set to VARIANT_FALSE, SQLOLEDB will only use one connection to the SQL Server for the session. By default, this property is set to VARIANT_TRUE, which allows SQLOLEDB to open multiple connections per session if needed.

Internally, the SQLOLEDB OLEDB provider may need to open an additional connection to obtain metadata for existing pending SQL statements. For example, if you prepare a parameterized SQL statement, SQLOLEDB may need to request metadata for the parameters if you do not explicitly set the parameter information. It is this situation that causes the "Object is open" error.

APPLIES TO
  • Microsoft Data Access Components 1.5
  • Microsoft Data Access Components 2.0
  • Microsoft Data Access Components 2.1
  • Microsoft Data Access Components 2.5
  • Microsoft Data Access Components 2.6
  • Microsoft OLE DB Provider for SQL Server 7.0
  • Microsoft OLE DB Provider for SQL Server 7.01
  • Microsoft OLE DB Provider for SQL Server 2000 2000.80.194
Keywords: 
kbprb KB286213
       

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