有人知道如何通过TADOQuery使用多个数据集吗,请帮忙!

解决方案 »

  1.   

    什么意思,最好说清楚。
    一个sql命令本身就可以使用多个数据集呀。
      

  2.   

    可以啊,只要按照SQL语言编写就可以,如果不行,里边有决策控件,你可以使用那些
      

  3.   

    declare @count int
    declare @Superior varchar(20)
    declare @countNum int
    declare CustCursor Cursor for
    select superior,count(superior) as RecordeCount
    from [stuff]
    group by Superior
    for read only
    open custcursor
    set @count=0while (1=1)
    begin
     Fetch Next
      from CustCursor
      into @Superior,@CountNum
      print @Superior
      print @countNum
     if(@@FETCH_STATUS <>0)
     begin
       print 'break'
       break;
     end
     select * From [stuff]
     where superior=@Superior
     Set @count=@count+1
    end
    close custcursor
    deallocate custcursorGO
    这是我的SQL语句我如何在TADOQuery中选择使用那个数据集
      

  4.   

    也就是说有没有人会用TADOQuery的 NextRecordSet方法,
    这个方法有人会用吗
      

  5.   

    好象一个ADOQuery是不支持多个数据集.
    用多个啦.
      

  6.   

    帮助里的
    var
      TempDataSet: TCustomSQLDataSet;
      nRows: Integer;
    begin
      TempDataSet := SQLStoredProc1; // start with 1st record set
      while TempDataSet <> nil do
      begin
        TempDataSet.First;
        while not TempDataSet.Eof do
        begin
          // process each record
          TempDataSet.Next;
        end;
        if TempDataSet <> SQLStoredProc1 then // don’t free the original!
          TempDataSet.Free;    TempDataSet := SQLStoredProc1.NextRecordSet; // get next set
      end;
    end;
      

  7.   

    不好意思,这是BDE的,不是ADO的,谢谢!
      

  8.   

    select * from a jion b
      

  9.   

    我现在将问题改为----------如何用TADOQuery的NextRecordSet
      

  10.   

    这个需要adoquery调用存储过程,在存处过程中返回多个数据集才能够使用,否则那来的多个数据集?The ADO Recordset object returned by NextRecordset must be assigned to the Recordset property of an ADO dataset component, such as TADODataSet, to be accessible.这个是delphi的帮助,我没有用过,但是我认为应该不困难。