FIX: Incorrect native SQL error information when you use SQLXML to retrieve data (826770)



The information in this article applies to:

  • SQLXML 2.6 SP2
  • Microsoft Data Access Components 2.7 SP1
  • 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, but it is only intended to correct the problem that this article describes. Apply it only to systems that are experiencing this specific problem.

To resolve this problem, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone 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
   --------------------------------------------------------------
   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 "Applies to" 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: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\SQLXMLX
  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.

Modification Type:MajorLast Reviewed:4/7/2006
Keywords:kbQFE KBHotfixServer kbfix kbbug KB826770 kbAudDeveloper