delphi 7 的AdoStoredProc 调用存储过程查询出两个结果集怎么分别绑定到两个GRID上?

解决方案 »

  1.   

    一个一个查,先查一个然后显示到一个grid上,再查一次再显示到另一个就行啦
      

  2.   

    放两个数据集控件和两个datasouce控件,datasouce控件连接GRID,把查询的结果赋给两个数据集控。 
      

  3.   

    CREATE   PROCEDURE   test   AS
    select   *   from   table1
    select   *   from   table2
    GO这样就存储过程就是返回了2个记录集,在Delphi写的客户端用 adostoreproc.nextrecordset()就得到2个记录集。 
      

  4.   


    楼上的。我是要直接绑定到GRID可以吗。我现在只能绑第一个数据集
      

  5.   

    你用一个DBGrid2->DataSource->ADOQUERY=adostoreproc.nextrecordset()就OK喽
      

  6.   

    var ReturnRecordSet:_Recordset;ReturnRecordSet:=ADOStoredProc1.Recordset;
    ADOQuery1.Recordset:=ReturnRecordSet;ReturnRecordSet:=ReturnRecordSet.NextRecordset(RecordsAffected);
    ADOQuery2.Recordset:=ReturnRecordSet;Grid1->DataSource->DS1->ADOQuery1
    Grid2->DataSource->DS2->ADOQuery2