从数据库中,查询出几千条数据,请问我怎么用DBGrid来分页显示,请问有什么好的办法吗?

解决方案 »

  1.   

    procedure TForm1.DBGridKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
    if Key = VK_F8 thenSendMessage(DBGrid1.Handle,{ HWND of the Memo Control }WM_VSCROLL,{ Windows Message }SB_PAGEDOWN{ Scroll Command },0) { Not Used }
    else if Key = VK_F7 thenSendMessage(DBGrid1.Handle,{ HWND of the Memo Control }WM_VSCROLL,{ Windows Message }SB_PAGEUP,{ Scroll Command }0); { Not Used }end;
      

  2.   

    http://community.csdn.net/Expert/topic/3081/3081524.xml?temp=.2068598 试一下能不能行
      

  3.   

    我刚解决了这样的问题,我是用存储过程来实现的,在你的存储过程中加@pagesize,(每页条数)和@page(从第几页开始查)这两个参数,具体的你可发信息我
      

  4.   

    我有办法,用sql语句,每次只去符合条件的n条,比如第一次取10条、第二次顺取十条...但你的分值也太少了吧!
      

  5.   

    clientdataset.pagesize:=10;看看李维的书吧
      

  6.   

    delphi7的TClientDataSet没有pagesize属性!!!