我有个问题想问各位大虾:
我要对一个表里面的数据进行分批读取,而且要从后往前,比如我一个数据表中有100条记录,我要先显示90-100,然后80-89,70-89~~~~~~~~~~~``如何实现呢?

解决方案 »

  1.   

    那你就分批用MovePre来读
    10个读一次!
      

  2.   


            //Display Names and hire dates, five records at a time
            pRstEmployees->PageSize = 5;        int intPageCount = pRstEmployees->PageCount;
            
            for(int intPage=1;intPage<=intPageCount;intPage++)
            {
                pRstEmployees->put_AbsolutePage((enum PositionEnum)intPage);
                strMessage = "";            for(int intRecord=1;
                    intRecord<=pRstEmployees->PageSize;intRecord++)
                {
        
                    //do something here ...
                    ...                pRstEmployees->MoveNext();                if(pRstEmployees->EndOfFile)
                        break;
                }
            }
      

  3.   

    Actually as smallerkk(smallerkk) said, paging perhaps the best method of all,
    u can open the recordset with descending or ascending sort,then specify the pagesize u like