dstGetPrice.Open; Result := dstGetPrice.FieldByName(fPrice).AsString; end;edtPrice.Text := GetPrice(edtBarCode.Text);
with query1 do begin close; sql.clear; sql.add('select * from tableprice where priceid=''1000'''); if prepared=False then Prepare; open; end; Sprice:=query1.fieldbyname('priceid').Asstring;
const
SQL = 'select 商品价格 from 表' +
'where 条码 = :fBarCode';
begin
dstGetPrice.Active := False
dstGetPrice.CommentText := SQL;
dstGetPrice.Parameters.ParamByName('fBarCode').Value := ABarCode;
dstGetPrice.Open;
Result := dstGetPrice.FieldByName(fPrice).AsString;
end;edtPrice.Text := GetPrice(edtBarCode.Text);
begin
close;
sql.clear;
sql.add('select * from tableprice where priceid=''1000''');
if prepared=False then Prepare;
open;
end;
Sprice:=query1.fieldbyname('priceid').Asstring;