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’”