H
hqlww
Unregistered / Unconfirmed
GUEST, unregistred user!
请找出错误?
procedure TForm1.Button2Click(Sender: TObject);
var
s:string;
begin
s:='';
if radiobutton1.checked then s:=s+'dept like:dept_1'
else if radiobutton2.checked then s:=s+'salary>:salary_1'
else if radiobutton3.checked then s:=s+'sex like:sex_1';
if s<>'' then
begin
close;
query1.sql.clear;
query1.sql.add('select * from yuangong.db');
query1.sql.add('where'+s);
if radiobutton1.checked then
query1.params.paramValues['dept_1']:=combobox1.text
else if radiobutton2.checked then
query1.params.paramValues['salary_1']:=strtoint(edit2.text)
else query1.params.paramValues['sex_1']:=combobox2.text;
query1.open;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
s:string;
begin
s:='';
if radiobutton1.checked then s:=s+'dept like:dept_1'
else if radiobutton2.checked then s:=s+'salary>:salary_1'
else if radiobutton3.checked then s:=s+'sex like:sex_1';
if s<>'' then
begin
close;
query1.sql.clear;
query1.sql.add('select * from yuangong.db');
query1.sql.add('where'+s);
if radiobutton1.checked then
query1.params.paramValues['dept_1']:=combobox1.text
else if radiobutton2.checked then
query1.params.paramValues['salary_1']:=strtoint(edit2.text)
else query1.params.paramValues['sex_1']:=combobox2.text;
query1.open;
end;
end;