begin
try
adoquery1.close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('insert into 比赛录入 (分数二,顺序二,对手一) values (:dd,:bb,:cc) where 姓名='+char(39)+dbtext1.Field.Value+char(39));
adoquery1.Parameters.ParamByName('dd').Value:=edit1.text;
adoquery1.Parameters.ParamByName('bb').Value:=edit2.Text;
adoquery1.Parameters.ParamByName('cc').Value:=edit3.text;
adoquery1.ExecSQL;
except
raise;
end;
end;// 加 :
begin
try
adoquery1.close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('insert into 比赛录入 (分数二,顺序二,对手一) values (:dd,:bb,:cc) where 姓名='+char(39)+dbtext1.Field.Value+char(39));
adoquery1.Parameters.ParamByName('dd').Value:=edit1.text;
adoquery1.Parameters.ParamByName('bb').Value:=edit2.Text;
adoquery1.Parameters.ParamByName('cc').Value:=edit3.text;
adoquery1.ExecSQL;
except
raise;
end;
end;// 加 :
Delphi中规定::后面的即为参数!!!
你不加:
系统不会把它作为参数使换~~