with ADOQuery1 do
      begin
        close;
        SQL.Clear;
        SqL.Add('select * from mytable where id=:q;');
        Parameters.ParamByName('q').Value  :='22';
        i:=adoquery1.RecordCount;
        execSQL;
      end;
      showmessage('搜到'+inttostr(i)+'条数据');错误信息为adoquery1:cannot perform this operation on a closed dataset。我知道这句话的大体意思是数据集已关闭。但是如何修正这段代码呢 ???谢谢啊。