国产18禁黄网站免费观看,99爱在线精品免费观看,粉嫩metart人体欣赏,99久久99精品久久久久久,6080亚洲人久久精品

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

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