少妇AV一区二区三区无|久久AV电影一区三|日本一级片黄色毛片|亚洲久久成人av在线久操|黄色视频在线免费看呀一区二区|综合精品视频精品久久久浪朝|亚洲午夜成人资源|欧美黄色一级片黑寡妇|内射无毛少妇特写|无码农村夜晚偷拍啪啪

通過OLEDB連接MSSQLServer時(shí)出現(xiàn)亂碼的解決方法

時(shí)間:2008-09-22 03:14:00   來源:無憂考網(wǎng)     [字體: ]
當(dāng)使用OLE DB方式與MS SQL Server連接時(shí),如果數(shù)據(jù)庫(kù)的代碼頁(yè)與本地的不同,當(dāng)進(jìn)行查詢時(shí)字符的返回值就會(huì)變成 ? 或是亂碼, 微軟的網(wǎng)站上說這是一個(gè)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.

我的解決方法是關(guān)掉 自動(dòng)字符轉(zhuǎn)換. 例子如下:(PowerBuilder 中)

SQLCA.DBMS = ’OLE DB’

SQLCA.LogID = ’sa’

SQLCA.LogPass = ’’

SQLCA.DBParm = “PROVIDER=’SQLOLEDB’, DataSource=’my-server’, CommitOnDisconnect=’no’, ProviderString=’Database=mydb, AutoTranslate=no’”