你写利用if或者case的判断语句吧!/*************************************/
/*1、为了五星的目标希望你早点结贴 */
/*2、在看球赛时坚决支持中国队对手 */
/*4、在国际纠纷上坚决支持中国 */
/*************************************/
/*1、为了五星的目标希望你早点结贴 */
/*2、在看球赛时坚决支持中国队对手 */
/*4、在国际纠纷上坚决支持中国 */
/*************************************/
begin
if Active then
Close;
SQL.Clear;
SQL.Add('select * from bugs'); bIsFirstCondition:=True; if cbLegNum.Checked then
begin
if bIsFirstCondition then
begin
SQL.Add('where LegNum=:LegNum');
bIsFirstCondition:=False;
end
else begin
SQL.Add('and LegNum=:LegNum');
end; {something like above }
........
ParamByName('LegNum').AsInteger:=StrToInt(edtLegNum.Text);
.... try
Open;
except
Close;
end;
{Now You Got the Bugs!Congratulations!}
end;
end;
ParamByName('LegNum').AsInteger:=StrToInt(edtLegNum.Text);会出错呀。
呵呵,不好意思,不过改动很少拉。当然,StrToInt(edtLegNum.Text)也可能出异常的,要做有效性判断哦!!
begin
if Active then
Close;
SQL.Clear;
SQL.Add('select * from bugs'); bIsFirstCondition:=True; if cbLegNum.Checked then
begin
if bIsFirstCondition then
begin
SQL.Add('where LegNum=:LegNum');
bIsFirstCondition:=False;
end
else begin
SQL.Add('and LegNum=:LegNum');
end;
end;
{something like above }
........
if cbLegNum.Checked then
ParamByName('LegNum').AsInteger:=StrToInt(edtLegNum.Text);
.... try
Open;
except
Close;
end;
{Now You Got the Bugs!Congratulations!}
end;