with adoquery1 do
begin
b:=trim(Rzedit2.text);
sql.Clear;
s:='update cjtab_Glcbfz set itemdesc=:b where itemid =:d and itemdesc=:e and itemvalue=:f';
sql.add(s);
adoquery1.parameters.parambyname('b').value:=b;
adoquery1.parameters.parambyname('d').value:=RzDb1.text;
adoquery1.parameters.parambyname('e').value:=RzDb2.text;
adoquery1.parameters.parambyname('f').value:=strtofloat(RzDb3.text);
//showmessage(sql.Text);
execsql;
我在RzEdit2中输入'好的好的好的'但是执行完以后数据库中的值变成了'好的?'
我跟踪了下,发现b的值还是对的,但是adoquery1.parameters.parambyname('d').value就不对了。而英文输入好象是没有问题的,请问有什么方法解决吗?急啊!
begin
b:=trim(Rzedit2.text);
sql.Clear;
s:='update cjtab_Glcbfz set itemdesc=:b where itemid =:d and itemdesc=:e and itemvalue=:f';
sql.add(s);
adoquery1.parameters.parambyname('b').value:=b;
adoquery1.parameters.parambyname('d').value:=RzDb1.text;
adoquery1.parameters.parambyname('e').value:=RzDb2.text;
adoquery1.parameters.parambyname('f').value:=strtofloat(RzDb3.text);
//showmessage(sql.Text);
execsql;
我在RzEdit2中输入'好的好的好的'但是执行完以后数据库中的值变成了'好的?'
我跟踪了下,发现b的值还是对的,但是adoquery1.parameters.parambyname('d').value就不对了。而英文输入好象是没有问题的,请问有什么方法解决吗?急啊!
begin
b:=trim(Rzedit2.text);
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
s:='update cjtab_Glcbfz set itemdesc=:b where itemid =:d and itemdesc=:e and itemvalue=:f';
ADOQuery1.SQL.add(s);
ADOQuery1.open;
begin
b:=trim(Rzedit2.text);
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
s:='update cjtab_Glcbfz set itemdesc=:b where itemid =:d and itemdesc=:e and itemvalue=:f';
ADOQuery1.SQL.Add(s);
ADOQuery1.Open;
create table cjtab_Glcbfz (
itemid char(3) not null, /*id*/
itemdesc char(40), /*描述*/
itemvalue numeric(8,2) default 0 /*管理成本分值*/
) /* End of cjtab_Glcbfz table defination */
应该够大了啊。SYBASE的库。
begin
b:=trim(Rzedit2.text);
sql.Clear;
s:=format('update cjtab_Glcbfz set itemdesc=%s where itemid=%s and itemdesc=%s and itemvalue=%s',[QuotedStr(b),QuotedStr(RzDb1.text),QuotedStr(RzDb2.Text),RzDb3.Text]);
sql.add(s);
execsql;
end;
事件中adoquery1.Parameters.ParamByName('b').value:= trim(adoquery1.Parameters.ParamByName('b').value);
就可以解决,但是应该尽量不在语句中使用中文参数。(这是在三层应用我的解决办法)
zhlwyy(海龙) 的 方法应该是可行的。
howwise(Icold) ( ) 信誉:100 的办法可行。非常感谢问题已经解决。