Microsoft KB Archive/279760

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

Article ID: 279760

Article Last Modified on 2/12/2007

-

APPLIES TO


 * Microsoft OLE DB Provider for SQL Server 7.0
 * Microsoft Data Access Components 2.6
 * Microsoft Windows 2000 Standard Edition
 * Microsoft Windows NT 4.0

-



This article was previously published under Q279760



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.



Steps to Reproduce Behavior
 Download the Microsoft MDAC 2.6 RTM components from the following Microsoft Web site:

http://msdn.microsoft.com/dataaccess

 Install the downloaded package on a Windows 2000 Professional, Server, or Advanced Server-based computer. On Control Panel, click Regional Options. Change settings for the current user to locale of country - not English (United States). Click Set Default, and then change the system locale to English (United States).</li>  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 = &quot;Provider=SQLOLEDB;Data Source=Server;Initial Catalog=non-existant db;Integrated Security= SSPI&quot; .Open End With Set cn = Nothing Exit Sub

ErrHandler: MsgBox &quot;Error Number: &quot; & cn.Errors(0).Number & &quot; Error Message: &quot; & cn.Errors(0).Description End Sub </li> Note that the message box shows the error number, but not the error description.</li></ol>

<div class="references_section">