Delphi中如何将SqL语句写入字符串,要做哪些改动才合法?
Delphi中将SQL语句写入字符串变量s里,然后运行Sql.add(s);//var//s:String;begin//s:='UpdateemplSete_salar...
Delphi中将SQL语句写入字符串变量s里,然后运行Sql.add(s);
//var
//s:String;
begin
//s:='Update empl Set e_salary=e_salary*'+QuotedStr((1+strToInt(Trim(Edit1.text))/100));
with ADOQuery1 do
begin
//SQL.Add(s);
SQL.Add('Update empl Set e_salary=e_salary*:Rate');
Parameters.ParamByName('Rate').Value:=1+StrToInt(Trim(Edit1.Text))/100;
ExecSQL;
end; 展开
//var
//s:String;
begin
//s:='Update empl Set e_salary=e_salary*'+QuotedStr((1+strToInt(Trim(Edit1.text))/100));
with ADOQuery1 do
begin
//SQL.Add(s);
SQL.Add('Update empl Set e_salary=e_salary*:Rate');
Parameters.ParamByName('Rate').Value:=1+StrToInt(Trim(Edit1.Text))/100;
ExecSQL;
end; 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询