Microsoft KB Archive/826770

= FIX: Incorrect native SQL error information when you use SQLXML to retrieve data =

Article ID: 826770

Article Last Modified on 11/15/2007

-

APPLIES TO


 * Microsoft SQLXML 3.0
 * Microsoft Data Access Components 2.7 Service Pack 1
 * Microsoft Data Access Components 2.8

-



Important This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry



SYMPTOMS
Applications that use SQLXML to retrieve data from a Microsoft SQL Server stored procedure may encounter incorrect native SQL Server error information. Native SQL Server error related fields such as HRESULT, SQLSTATE, Native Error, Error state, and Severity may contain incorrect results.



CAUSE
SQLXML does not return correct native SQL Server error values for SQLSTATE, Native Error, Error state, and Severity.



RESOLUTION
A supported hotfix is now available from Microsoft. However, this hotfix is intended to correct only the problem that this article describes. Apply this hotfix only to systems that are experiencing this specific problem.

To resolve this problem, submit a request to Microsoft Online Customer Services to obtain the hotfix. To submit an online request to obtain the hotfix, visit the following Microsoft Web site:

http://go.microsoft.com/?linkid=6294451

Note If additional issues occur or any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. To create a separate service request, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

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 --  29-Aug-2003  16:39  2000.81.9041.45   200,704  Sqlxmlx.dll 29-Aug-2003 16:39  2000.81.9041.45    28,672  Sqlxmlx.rll

Note For a list of all the hotfixes available for MDAC 2.8, click the following article number to view the article in the Microsoft Knowledge Base:

839801 FIX: Hotfixes are available for MDAC 2.8



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



MORE INFORMATION
In general, this SQLXML hotfix will cause the return of the correct SQL native error. However, to retrieve the correct HRESULT information, follow these steps:
 * 1) Locate the following registry key:
 * 2) Create the DWORD value ReportErrorsWithSQLInfo.
 * 3) Set ReportErrorsWithSQLInfo to 1.

WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk. When the stored procedure returns an error that the stored procedure failed because of a deadlock, the following values are returned:
 * HRESULT = 0X40EDA
 * SQLSTATE = (null)
 * Native Error = -2147467259
 * Error state = 1
 * Severity = 16
 * Source = Microsoft OLE DB Provider for SQL Server
 * Error Message = Transaction (Process ID XXX) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

In this case, the values for SQLSTATE, Native Error, Error State and Severity are incorrect. The correct values that you receive after you install the hotfix are as follows:
 * HRESULT = 0X40EDA
 * SQLSTATE = 40001
 * Native Error = 1205
 * Error state = 50
 * Severity =13
 * Source = Microsoft OLE DB Provider for SQL Server
 * Error Message = Transaction (Process ID XXX) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

Keywords: kbqfe kbhotfixserver kbfix kbbug KB826770

-

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

© Microsoft Corporation. All rights reserved.