with Query do begin Close; SQL.Clear; SQl.Add(insert into 表(字段名, ...) values(:字段名, ...)); Parameters.ParamByName('字段名').Value := StrToFloat(Trim(Edit1.Text)); ......... Prepared; ExecSQL; end;
另一种方案: qry.sql.text := Format('insert into tablename values(%f)', [edit.text]); qry.execsql;
begin
Close;
SQL.Clear;
SQl.Add(insert into 表(字段名, ...) values(:字段名, ...));
Parameters.ParamByName('字段名').Value := StrToFloat(Trim(Edit1.Text));
.........
Prepared;
ExecSQL;
end;
qry.sql.text := Format('insert into tablename values(%f)', [edit.text]);
qry.execsql;