我这样做的
sqlstring:='select * from student';
with adoquery do
begin
 sql.clear;
 sql.add(sqlstring);
 open;
 while (not recordset.EOF) and (not recordset.BOF) do
 begin
      showmessage(recordset.fields.item[1].value);
      recordset.movenext;
 end;end;
感觉不太好,有没有更好的办法?

解决方案 »

  1.   

    adoquery.First;
    while not adoquery.Eof do
    begin
      //...
      adoquery.Next;
    end;—————————————————————————————————
    宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。
    —————————————————————————————————
      

  2.   

    你的方法已经可以了,不过lxpbuaa的方法更标准一些,我们都是这么写的,似乎没有更好的办法了。
      

  3.   

    遍历一般都是: lxpbuaa这个老兄的!!
    我也试了一下你的,也不错。过去我还没这样写过。 
    但既然这样,你还想有多简单的啊?我看这个就比较简单了,呵呵
      

  4.   

    adoquery.First;  
    while  not  adoquery.Eof  do  
    begin  
       //...  
       adoquery.Next;  
    end;  怎么取adoquery中的值,我都是使用recordset中的值