Microsoft KB Archive/257670

= FIX: OLE DB Provider for SQL Server May Cause Incorrect Code Conversion of Some Characters =

Article ID: 257670

Article Last Modified on 10/7/2005

-

APPLIES TO


 * Microsoft OLE DB Provider for SQL Server 7.01
 * Microsoft OLE DB Provider for SQL Server 7.0
 * Microsoft Data Access Components 2.1

-



This article was previously published under Q257670



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
The Microsoft Data Access Components (MDAC) 2.1 or later version of the Microsoft OLE DB Provider for SQL Server may not store some ASCII and extended characters correctly if the code page for SQL Server does not match the client's code page. Instead, the characters are stored as "???".



CAUSE
The SQL Server ODBC driver (version 3.70.0623 or later) and the OLE DB provider (version 7.01.0623 or later) translate character data from the client code page to the server code page automatically by default. The translation may cause a problem in ODBC or OLE DB applications that store extended characters, if the client application does not use the same code page as the server and the client does not explicitly turn Autotranslation off when making the database connection.

To turn Autotranslation off when using the ODBC driver, add the attribute "AutoTranslate=no" in the ODBC connection string.

To turn the Autotranslation setting off when using the OLE DB provider, set the SSPROP_INIT_AUTOTRANSLATE property to VARIANT_FALSE. SSPROP_INIT_AUTOTRANSLATE is part of the provider-specific DBPROPSET_SQLSERVERDBINIT property set.



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. This fix may receive additional testing. Therefore, if you are not severely affected by this problem, Microsoft recommends that you wait for the next MDAC 2.1 service pack that contains this hotfix.

To resolve this problem immediately, 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:

http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

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 typical 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 should have the following file attributes or later:

  Date       Time     Version      Size      File name      Platform --

01/19/00  05:39a   07.01.0767   540,944   Sqloledb.dll   x86



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
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.

 Start the Registry Editor (Regedt32.exe).  Locate the following key in the registry: HKLM\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo\Autotranslate   On the Edit menu, click Add Value, and then add the following registry value:  Value Name: <SQL server name> Data Type: REG_DWORD Value 0x00000000 disables Autotranslation for connections to the specified SQL server as Value name.

Value 0x00000002 enables Autotranslation for connections to the specified SQL server as Value name. </li> Quit the Registry Editor.</li> Restart the client application.</li></ol>

If Autotranslation is specified in either the OLE DB initialization string or as a initialization property, this overrides the setting of the Registry key if it exists.