garbled solution when connecting to MSSQL server via OLE DB

Source: Internet
Author: User
Tags microsoft sql server mssql mssql server ole
server| resolves when using OLE DB to connect to MS SQL Server, if the code page of the database differs from the local, the return value of the character becomes when the query is made? Or garbled, Microsoft's website says this is a bug, and describes the following:
When you try to retrieve character data from a column with different collation than the client code page in Microsoft SQL OLE DB Provider (SQLOLEDB), you'll receive question marks (??) instead of correct of data when all the following conditions Are true:
a connection is made against A Microsoft SQL Server database.
Ssprop_init_autotranslate is set to TRUE. Ssprop_init_autotranslate is part of the Provider-specific Dbpropset_sqlserverdbinit property set.
A column is bound to an OLE DB Dbtype_wchar data type in the bindings structure.

My solution is to turn off the automatic character conversion. Examples are as follows: (PowerBuilder)
SQLCA. DBMS = ' OLE DB '
SQLCA. Logid = ' sa '
SQLCA. Logpass = ' '
SQLCA. Dbparm = "provider= ' SQLOLEDB ', datasource= ' my-server ', commitondisconnect= ' no ', providerstring= ' Database=mydb ', Autotranslate=no ' "

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.