2012-04-07 60 views
1

我正在將D7應用程序轉換爲D2009,並且我遇到了Advantage Database Server(本地)的問題。每當我在查詢中包含非參數化的土耳其字符時,我得到錯誤Advantage Database Server 10錯誤5211 - 轉換Unicode字符串時出現錯誤

[iAnywhere Solutions][Advantage SQL][ASA] 
Error 5211: There is an error converting Unicode string to or from code page string. 
Some Unicode characters cannot be converted to code page characters. 

我試過在命令中使用ansistrings,就像在;

AdsQuery1.SQL.Text:=AnsiString('SELECT something FROM sometable WHERE somefield=''somelocalçharaçterş'' '); 

但無濟於事。我還將AdsConnection的AdsCollat​​ion值設置爲ANSI,OEM,TURKISH-1254,但結果相同。有任何想法嗎?

+3

在我看來,只有當您使用*非參數化查詢*時,問題纔會發生,解決方案將非常明顯:使用*參數化*查詢。沒有? :) – 2012-04-07 16:04:24

+0

是的,但這將是非常耗時。我正在尋找對AdsConnection部分或某種類型的某種調整... – AgentAdams 2012-04-07 17:48:26

回答

2

你可以看看adslocal32.dll的同一目錄下的adscollat​​e.adt嗎?

根據幫助文件,問題的一個可能原因是服務器加載了舊版本的adscollat​​e.adt。 adscollat​​e.adt的10.0版本有一些額外的列,其中之一是「UnicodeLocale」。

adslocal.cfg中的ANSI/OEM設置是什麼?

如果你運行這個「SELECT :: stmt.collat​​ion FROM system.iota」,結果如何?

相關問題