有关ACCESS的SQL语句的用法问题!在线等待

mark521 2003-12-12 05:22:23
我有个问题想问各位大虾:
我要对一个表里面的数据进行分批读取,而且要从后往前,比如我一个数据表中有100条记录,我要先显示90-100,然后80-89,70-89~~~~~~~~~~~``如何实现呢?
...全文
80 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
AkiraChing 2003-12-15
  • 打赏
  • 举报
回复
???上面不是给代码了
mark521 2003-12-15
  • 打赏
  • 举报
回复
那如何分页呢?不好意思,我对这方面没有什么概念,麻烦说的详细点。最好有原代码哦
AkiraChing 2003-12-13
  • 打赏
  • 举报
回复
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
AkiraChing 2003-12-13
  • 打赏
  • 举报
回复

//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;
}


}
smallerkk 2003-12-13
  • 打赏
  • 举报
回复
分頁是最好的方法,就象網頁一樣,在DB中也可以這樣
sujiayi 2003-12-12
  • 打赏
  • 举报
回复
那你就分批用MovePre来读
10个读一次!
crystal_heart 2003-12-12
  • 打赏
  • 举报
回复
首先要对什么是“先后”进行精确的定义。

4,018

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 数据库
社区管理员
  • 数据库
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧