可不可以用where条件,我要把值添加到数组,最好有代码~谢谢

解决方案 »

  1.   

    with adoquery1 do 
     begin
      close;
      sql.clear;
      sql.add('select * from table where a=1');
     open;
     end;
    if adoquery1.recordcount>0 then
     begin
      showmessage(adoquery1.fieldbyname('a').asstring);
     end;
      

  2.   

    with adoquery1 do  
    begin
      Active := False
      sql.text := 'select * from table where a=1';
      Active := True;
      if recordcount>0 then
       First;
      while not Eof do
      begin
        这里面你就写你要的数组赋值;
        Next;
      end;
    end;