我就想往Adoquery里的sql属性添加sql语句,里面夹着 韩文 ,结果ado显示为?号!!
如下:
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('select * from tqxdj where name='''+tntedit1.Text+'''');
prepared;
//tntedit2.Text:=sql.Text;
open;
end;
其中tntedit1是第三方控件,它能够识别和显示 韩文,但到adoquery1.sql中后变为?了。
请前辈们多多指点!!!
to :happylcq 不太好使!
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('select * from tqxdj where name='''+wideCharToString(pWideChar(tntedit1.text))+'''');
prepared;
//tntedit2.Text:=sql.Text;
open;
end;
在tntEdit2.text中还是显示:select * from tqxdj where name='?'
也就是说wideCharToString()转换后还是不行!!?
adoDataSet 的 commandtext 可以显示 韩文,这真是很好!多谢多谢!可是新问题又出,就是查询不出来字段值是韩文的记录!! 如下:
with adoDataSet1 do
begin
close;
commandtext:='';
commandtext:='select * from tqxdj where name='''+trim(tntedit1.Text)+'''';
prepared;
tntedit2.Text:=commandtext;
open;
end;
其中 tntEdit2.text 显示为 select * from tqxdj where name='뮤'。不再是adoquery中的select * from tqxdj where name='?'了,可是明明数据库中有 뮤 这个值,怎么就是查不出来呢??