FIX: MDAC 2.6 SQLOLEDB Provider Running on Windows 2000 Returns No Error Text Description

Article translations Article translations
Article ID: 279760 - View products that this article applies to.
This article was previously published under Q279760
Expand all | Collapse all

On This Page

SYMPTOMS

Installing Microsoft Data Access Components MDAC 2.6 RTM on Windows 2000 or Windows NT 4.0 Professional, Server, or Advanced Server-based computers prevents error text description from being returned from the Microsoft OLE DB Provider for SQL Server (SQLOLEDB). The Microsoft OLE DB Provider for ODBC (MSDASQL) is not affected.

CAUSE

Localization issues cause this bug. If the system locale settings are not set to match the user locale setting for non-United States locale settings, the SQLOLEDB Provider returns an error when it encounters one, but the description text associated with the error is not returned.

RESOLUTION

To resolve this problem, obtain the latest service pack for Microsoft Data Access Components 2.6. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
300635 INFO: How to Obtain the Latest MDAC 2.6 Service Pack
To resolve this problem, you can also follow these steps:
  1. On Control Panel, click Regional Options.
  2. Change settings for the current user to the locale for your particular country.
  3. Click Set Default, and then change the system locale to the locale for your particular country.

WORKAROUND

Although the error description is not raised to the correct objects, you can use the following workaround to retrieve it:
  • OLE DB API programmers can specify GetSystemDefaultLCID() for the LCID parameter in the IErrorRecords::GetErrorInfo call.
  • OLEDB Templates programmers can specify GetSystemDefaultLCID() for the LCID parameter in the CDBErrorInfo::GetAllErrorInfo call.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft Data Access Components 2.6 Service Pack 1.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Download the Microsoft MDAC 2.6 RTM components from the following Microsoft Web site:
    http://msdn.microsoft.com/en-us/data/aa937729.aspx
  2. Install the downloaded package on a Windows 2000 Professional, Server, or Advanced Server-based computer.
  3. On Control Panel, click Regional Options.
  4. Change settings for the current user to locale of country - not English (United States).
  5. Click Set Default, and then change the system locale to English (United States).
  6. Create a Visual Basic application that contains the following code:
    Private Sub Form_Load()
     On Error GoTo ErrHandler
     Dim str As String
       Dim cn As ADODB.Connection
       Set cn = New ADODB.Connection
       With cn
          .ConnectionString = "Provider=SQLOLEDB;Data Source=Server;Initial Catalog=non-existant db;Integrated Security= SSPI"
          .Open
       End With
       Set cn = Nothing
       Exit Sub
    
    ErrHandler:
       MsgBox "Error Number: " & cn.Errors(0).Number & "  Error Message: " & cn.Errors(0).Description
    End Sub
    					
  7. Note that the message box shows the error number, but not the error description.

REFERENCES

For additional information, click the article number below to view the article in the Microsoft Knowledge Base:
300634 INFO: List of Bugs Fixed in MDAC 2.6 Service Pack 1

Properties

Article ID: 279760 - Last Review: February 12, 2007 - Revision: 6.3
APPLIES TO
  • Microsoft OLE DB Provider for SQL Server 7.0
  • Microsoft Data Access Components 2.6
  • the operating system: Microsoft Windows 2000
  • Microsoft Windows NT 4.0
Keywords: 
kbqfe kbhotfixserver kbbug kbfix KB279760

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com