【问题标题】:Advantage Database Server 10 error 5211 - There is an error converting Unicode stringAdvantage Database Server 10 错误 5211 - 转换 Unicode 字符串时出错
【发布时间】:2012-04-07 12:42:25
【问题描述】:

我正在将 D7 应用程序转换为 D2009,并且遇到了 Advantage 数据库服务器(本地)的问题。每当我在查询中包含非参数化土耳其语字符时,我都会收到错误

[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,比如 in;

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

但无济于事。我还将 AdsConnection 的 AdsCollat​​ion 值设置为 ANSI、OEM、TURKISH-1254,但结果是一样的。有什么想法吗?

【问题讨论】:

  • 在我看来,由于问题只发生在您使用 非参数化查询 时,解决方案将非常明显:使用 参数化 查询.不? :)
  • 是的,但这会非常耗时。我一直在寻找对 AdsConnection 部分进行某种调整或某种调整...

标签: delphi unicode delphi-2009 advantage-database-server


【解决方案1】:

你能看一下 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”会有什么结果?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-09
    • 1970-01-01
    • 1970-01-01
    • 2014-02-27
    • 2019-02-16
    相关资源
    最近更新 更多