欢迎光临
我们一直在努力

通过 OLE DB 连接 MSSQL Server时出现乱码的解决方法-数据库专栏,SQL Server

建站超值云服务器,限时71元/月

当使用ole db方式与ms sql server连接时,如果数据库的代码页与本地的不同,当进行查询时字符的返回值就会变成 ? 或是乱码, 微软的网站上说这是一个bug, 并且描述如下:
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 may receive question marks (??) instead of correct data when all the following conditions are true:
•a connection is made against a microsoft sql server 2000 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 oledb dbtype_wchar data type in the bindings structure.

我的解决方法是关掉 自动字符转换. 例子如下:(powerbuilder 中)
sqlca.dbms = ole db
sqlca.logid = sa
sqlca.logpass =
sqlca.dbparm = “provider=sqloledb, datasource=my-server, commitondisconnect=no, providerstring=database=mydb, autotranslate=no”

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 通过 OLE DB 连接 MSSQL Server时出现乱码的解决方法-数据库专栏,SQL Server
分享到: 更多 (0)

相关推荐

  • 暂无文章