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: Second Parameterized Command Fails with Server Cursor


View products that this article applies to.

This article was previously published under Q286213

↑ Back to the top


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.

↑ Back to the top


Status

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

↑ Back to the top


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.

↑ Back to the top


Keywords: KB286213, kbprb

↑ Back to the top

Article Info
Article ID : 286213
Revision : 4
Created on : 11/3/2003
Published on : 11/3/2003
Exists online : False
Views : 344