quary 查询出多个数据库记录(多于2个)  怎么做一个button  可以查看下条记录

解决方案 »

  1.   

    为什么我next只能显示下一条 当有3条记录时 我只能查看到第2条 
      

  2.   

    while (not Query1.Eof) do
    begin
      ...
      Query1.Next;
    end;
      

  3.   

    执行下一条的button 不再执行查询  而是直接显示下一条记录 怎么弄
      

  4.   

    看看效果procedure TForm1.FormCreate(Sender: TObject);
    begin
     Query1.DatabaseName:='DBDEMOS';
     Query1.SQL.Clear;
     Query1.SQL.Add('select * from orders');
     Query1.Open;
     DataSource1.DataSet:=Query1;
     DBGrid1.DataSource:=DataSource1;
    end;procedure TForm1.Button1Click(Sender: TObject);
    begin
    if Query1.active then
      if not Query1.Eof then
        Query1.Next;
    end;
      

  5.   

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    if Query1.active then
      if not Query1.Eof then
        Query1.Next;
    end;
      

  6.   

    procedure TForm1.Button1Click(Sender: TObject); 
    begin 
    if Query1.active then 
      if not Query1.Eof then 
        Query1.Next; 
    end;
      

  7.   

    好象不可以啊  我的记录是显示在edit里的 我要点那个button , edit显示是下一条记录