数据有1000条,按钮是“下一页”或“上一页”功能让它上或下每页显示10条.
with AdoQuery1 do
begin
close;
sql.Clear;
sql.Add('SELECT * from A order by id desc');
Open;
Recordset.PageSize:=10;
Recordset.AbsolutePage:=2;
while not AdoQuery1.eof do
begin
StringGrid1.Cells[0,i]:=Fields[0].Value;
StringGrid1.Cells[1,i]:=Fields[1].Value;
Next;
end; 怎么不显示呢。请高手代我修改写全点。谢谢
with AdoQuery1 do
begin
close;
sql.Clear;
sql.Add('SELECT * from A order by id desc');
Open;
Recordset.PageSize:=10;
Recordset.AbsolutePage:=2;
while not AdoQuery1.eof do
begin
StringGrid1.Cells[0,i]:=Fields[0].Value;
StringGrid1.Cells[1,i]:=Fields[1].Value;
Next;
end; 怎么不显示呢。请高手代我修改写全点。谢谢
解决方案 »
- Win7 /8/2008下特定文件 tfilestream 获取文件大小异常!
- delphi7可以编辑自带的VCL控件的源码吗?
- 不重复创建子窗体
- IntraWeb全程制作BBS,提供所有资源及源代码!
- 求救? 以Delphi5开发的政府专用发票打印系统中的报表存在问题.
- 急!!! 资源文件中放入文本文件! 100分啊!
- 什么是多线程!其执行过程如何?急急急!!!!
- 怎样获取系统时间(在线,马上给分)
- 我的实现修改保存对话框的保存按钮的CAPTION成备份(&B)的这段代码为什么不管用?
- 多线程求助!从线程在后台查询数据,显示窗口在主form上,使用ADO控件,100分!
- delphi fastreport 4 界面乱码
- 急,急,关于解压缩的问题
begin
close;
sql.Clear;
sql.Add('SELECT * from A order by id desc');
Open;
Recordset.PageSize:=10;
Recordset.AbsolutePage:=2; while not AdoQuery1.eof do
begin
StringGrid1.RowCount := StringGrid1.RowCount + 1; // 新增一行
StringGrid1.Rows[StringGrid1.RowCount-1][0]:=Fields[0].AsString; // 修改最后一行的第1列和第2列
StringGrid1.Rows[StringGrid1.RowCount-1][1]:=Fields[1].AsString;
Next;
end; end;
上面没有用的。不过我自己解决了。
参考:http://www.techrss.cn/html/2007/05-13/8480.htm