例用AdoQuery分页

这篇博客展示了如何在Delphi中利用AdoQuery组件进行分页查询。在FormCreate事件中设置AdoConnection1的连接字符串并打开连接。Page_Count函数用于填充TListView,每次显示10条记录,并在Button1Click和Button2Click事件中实现翻页功能,更新显示的页数。
摘要由CSDN通过智能技术生成
<script type="text/javascript"> google_ad_client = "pub-8800625213955058"; /* 336x280, 创建于 07-11-21 */ google_ad_slot = "0989131976"; google_ad_width = 336; google_ad_height = 280; // </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> 首先在窗体上放个listview,两个button,一个label,一个adoquery,一个adoconnection
然后用adoconnection建立一个连接

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB,Grids, DBGrids, StdCtrls, ComCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
ADOConnection1: TADOConnection;
ADOQuery1: TADOQuery;
ListView1: TListView;
Label1: TLabel;
Button2: TButton;
procedure FormCreate(Sender: TObject);
procedu

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值