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: Corrupted Data When You Enable Asynchronous Fetching in SQL Server ODBC Driver


View products that this article applies to.

Symptoms

When you use Microsoft ODBC Driver for SQL Server to fetch data in asynchronous mode, you may see that the data that is fetched is corrupted for some of the columns. This corruption does not always occur, and is random in nature. Most of the time you see that some columns of the last row that is fetched have corrupted data.

This corruption may occur when you use ODBC Driver for SQL Server that is included with the following:
  • MDAC 2.5 SP1, SP2, and SP3
  • MDAC 2.6 SP1 and SP2
  • MDAC 2.7 SP1
and you have enabled asynchronous fetching. The corruption does not occur when you use sequential fetching.

↑ Back to the top


More information

An application can enable asynchronous fetching by calling the following ODBC APIs:
        SQLSetConnectAttr((SQLHDBC)hdbc, SQL_ATTR_ASYNC_ENABLE,(SQLPOINTER)SQL_ASYNC_ENABLE_ON, SQL_IS_UINTEGER)
        SQLSetStmtAttr((SQLHSTMT)hstmt,SQL_ATTR_ASYNC_ENABLE,(SQLPOINTER)SQL_ASYNC_ENABLE_ON, SQL_IS_UINTEGER);
        

Workaround

To work around this problem, an application can fetch the data synchronously. By default, ODBC Driver for SQL Server sets the SQL_ATTR_ASYNC_ENABLE property to SQL_ASYNC_ENABLE_OFF. If an application must fetch the data asynchronously, you must install the fix listed in this article.

The hotfix in this article is only for MDAC 2.7 SP1.

↑ Back to the top


Resolution

A supported fix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Apply it only to computers that are experiencing this specific problem.

To resolve this problem, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site:NOTE: In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

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        Time   Version             Size    File name
   --------------------------------------------------------------
   20-Dec-2002  22:23  2000.81.9031.21    24,576  Odbcbcp.dll      
   20-Dec-2002  22:22  2000.81.9031.21   385,024  Sqlsrv32.dll     
   23-Dec-2002  20:23  6.0.2600.0        300,544  811007_mdac27_x86.exe  
				

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section of this article.

↑ Back to the top


Keywords: KB811007, kbhotfixserver, kbdatabase, kbqfe, kbfix, kbbug

↑ Back to the top

Article Info
Article ID : 811007
Revision : 5
Created on : 9/27/2005
Published on : 9/27/2005
Exists online : False
Views : 432