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.

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


View products that this article applies to.

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.

↑ Back to the top


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

↑ Back to the top


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.
   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.
   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 "Connection is busy with results for another hstmt" error message.
  • Create a separate connection to execute each query to prevent this error from occurring.

↑ Back to the top


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.

↑ Back to the top


More information

Steps to Reproduce the Behavior

  1. Start the ODBC Test utility that is included with the MDAC Software Development Kit (SDK).
  2. On the Conn menu, click Full Connect.
  3. 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.
  4. On the Stmt menu, click SQLExecDirect. Add the following query to the Stmt box, and then click OK:
    select * from authors
    					
  5. On the Env menu, click SQLAllocHandle. Under HandleType, click SQL_HANDLE_STMT=3(3.0), and then click OK.
  6. 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 ?
    					
  7. On the Stmt menu, click SQLDescribeParam, and then click OK. Notice that SQL_SUCCESS is returned instead of SQL_ERROR.

↑ Back to the top


Keywords: kbhotfixserver, kbqfe, kbsqlserv2000sp3fix, kbbug, kbfix, kbsqlserv2000presp3fix, KB321255

↑ Back to the top

Article Info
Article ID : 321255
Revision : 6
Created on : 2/22/2007
Published on : 2/22/2007
Exists online : False
Views : 351