Z
zhangshuze
Unregistered / Unconfirmed
GUEST, unregistred user!
IF (DBEdit5.Text <> '') OR (DBEdit6.Text<>'') Or (DBEdit5.Text = '0') OR
(DBEdit6.Text='0') then
in_data.ADOQuery1.Edit;
in_data.ADOQuery1.FieldByName('heji').AsFloat:=
StrToFloat(DBEdit5.Text) * strtoFloat(DBEdit6.Text)
end;
其中 DBEdit5.Text的列为数量 DBEdit6.Text 的列为单价
ADOQuery1的sql为
select new_id,
mingcheng,
shuliang,
jine,
shuliang * jine as heji
from in_db
为什么in_data.ADOQuery1.FieldByName('heji').AsFloat:=
StrToFloat(DBEdit5.Text) * strtoFloat(DBEdit6.Text)
会有错呢?
(DBEdit6.Text='0') then
in_data.ADOQuery1.Edit;
in_data.ADOQuery1.FieldByName('heji').AsFloat:=
StrToFloat(DBEdit5.Text) * strtoFloat(DBEdit6.Text)
end;
其中 DBEdit5.Text的列为数量 DBEdit6.Text 的列为单价
ADOQuery1的sql为
select new_id,
mingcheng,
shuliang,
jine,
shuliang * jine as heji
from in_db
为什么in_data.ADOQuery1.FieldByName('heji').AsFloat:=
StrToFloat(DBEdit5.Text) * strtoFloat(DBEdit6.Text)
会有错呢?