Microsoft KB Archive/321255

= FIX: ODBC Driver for SQL Server 2000 Incorrectly Returns SQL_SUCCESS on SQLDescribeParam =

Article ID: 321255

Article Last Modified on 2/22/2007

-

APPLIES TO

 Microsoft ODBC Driver for SQL Server 2000 2000.81.7713.0, when used with:  Microsoft Data Access Components 2.6

 Microsoft Data Access Components 2.7  Microsoft ODBC Driver for SQL Server 2000 2000.80.194, when used with:  Microsoft Data Access Components 2.6

 Microsoft Data Access Components 2.7</li></ul> </li> Microsoft ODBC Driver for SQL Server 2000 2000.80.380, when used with:  Microsoft Data Access Components 2.6</li></ul>

 Microsoft Data Access Components 2.7</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q321255

<div class="symptoms_section">

SYMPTOMS
When you use the Microsoft SQL Server driver that is included with Microsoft Data Access Components (MDAC) version 2.6 or 2.7, if you call the SQLDescribeParam function on a connection that is busy with results for another statement handle, SQL_SUCCESS is returned instead of SQL_ERROR.

This problem does not occur with the SQL Server driver that is included with MDAC version 2.5.

<div class="cause_section">

CAUSE
This problem occurs because the return code is not set to SQL_ERROR, even though you receive the following error message:

[Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt

<div class="resolution_section">

RESOLUTION
To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack

MDAC 2.7
The English version of this fix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel. <pre class="fixed_text">  Date         Version         Size           File Name -  19-Apr-2002  2000.81.8508.0  356,352 bytes  Sqlsrv32.dll 19-Apr-2002 2000.81.8508.0   90,112 bytes  Sqlsrv32.rll 19-Apr-2002 2000.81.8508.0   24,576 bytes  Odbcbcp.dll

MDAC 2.6
The English version of this fix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel. <pre class="fixed_text">  Date         Version        Size           File Name -  26-Apr-2002  2000.80.617.0  475,217 bytes  Sqlsrv32.dll 26-Apr-2002 2000.80.617.0   90,112 bytes  Sqlsrv32.rll 26-Apr-2002 2000.80.617.0   29,252 bytes  Odbcbcp.dll

WORKAROUND
To work around this problem, use one of the following methods:
 * Open a server-side cursor instead of a forward-only, read-only result set to avoid the &quot;Connection is busy with results for another hstmt&quot; error message.
 * Create a separate connection to execute each query to prevent this error from occurring.

<div class="status_section">

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft SQL Server 2000 Service Pack 3.

<div class="moreinformation_section">

Steps to Reproduce the Behavior
<ol> Start the ODBC Test utility that is included with the MDAC Software Development Kit (SDK).</li> On the Conn menu, click Full Connect.</li> Select a data source name (DSN) to connect to your server that is running SQL Server, type the correct User ID and Password, and then click OK.</li>  On the Stmt menu, click SQLExecDirect. Add the following query to the Stmt box, and then click OK: select * from authors </li> On the Env menu, click SQLAllocHandle. Under HandleType, click SQL_HANDLE_STMT=3(3.0), and then click OK.</li>  On the Stmt menu, click SQLPrepare. Add the following query to the Stmt box, and then click OK: select * from authors where au_lname like ? </li> On the Stmt menu, click SQLDescribeParam, and then click OK. Notice that SQL_SUCCESS is returned instead of SQL_ERROR.</li></ol>

Additional query words: connection busy SQL driver 2.6/2.7

Keywords: kbhotfixserver kbqfe kbsqlserv2000sp3fix kbbug kbfix kbsqlserv2000presp3fix KB321255

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.