H
happyfly051
Unregistered / Unconfirmed
GUEST, unregistred user!
初学者的我执行下面的代码会出错,好像是SQL语句没有执行,不知道为什么,请各位高手指教
with Unit1.Form1.qry1 do
begin
Close;
SQL.Clear;
SQL.Add('Select 姓名,手机,分组 from [Leaf] where' +'(' + Trim(cbb1.Text) + '= :b'+')'+
'and '+'('+ Trim(cbb2.Text) + '= :d'+')');
Parameters.ParamByName('b').Value := edt1.Text;
Parameters.ParamByName('d').Value := edt2.Text;
Open;
if not IsEmpty then
begin
grp2.Caption := '查询结果:共('+ IntToStr(qry1.RecordCount)+'条)记录';
end else
begin
grp2.Caption := '查询结果:共(0条)记录';
end;
end
with Unit1.Form1.qry1 do
begin
Close;
SQL.Clear;
SQL.Add('Select 姓名,手机,分组 from [Leaf] where' +'(' + Trim(cbb1.Text) + '= :b'+')'+
'and '+'('+ Trim(cbb2.Text) + '= :d'+')');
Parameters.ParamByName('b').Value := edt1.Text;
Parameters.ParamByName('d').Value := edt2.Text;
Open;
if not IsEmpty then
begin
grp2.Caption := '查询结果:共('+ IntToStr(qry1.RecordCount)+'条)记录';
end else
begin
grp2.Caption := '查询结果:共(0条)记录';
end;
end