我在delphi中用ODAC控件的TOraQuery查询时,有的表很大,查询时较慢,我想在查询运行过程中动态的显示当前查询到的记录数,如何做?
请大侠赐教!

解决方案 »

  1.   

    很羞愧的说,我也不会.我没用过那控件,但我好象看到过有个贴子里说TQuery怎么得到当前查到的记录数的,好象是需要分布式处理的系统吧.不过我想如果是用ODBC访问的,直接调用ODBC的API函数应该做的到吧?
      

  2.   

    我试过用线程做,但是不行,以下是部分源码
    procedure TRefThread.Execute;
    begin
        inherited;
        with FrmShowData do
        begin
            while true do
            begin
                if OraQry.Active then
                begin
                    try
                        StatusBar1.Panels[1].Text :=
                        '共有 ( '+IntToStr (OraQry.RecordCount)+' ) 条记录';
                        StatusBar1.Update;
                        DBGridData.Update;
                        FrmShowData.Update;
                    except
                        Sleep(10);
                    end;
                end;
                Sleep(10);
            end;
        end;
    end;
      

  3.   

    select count(*) form table