如何让DBGrid分段显示数据量很大的表。(200分)

  • 主题发起人 wanghuay
  • 开始时间
W

wanghuay

Unregistered / Unconfirmed
GUEST, unregistred user!
各位大侠:
我在编程时遇到一个问题,用dbgrid显示一个表中的数据时,由于表中的数据每次都有近
万条,用open后dbgrid中的数据都是一次传输的,这样导致显示等待时间过长。有没有那伟大侠
知道怎么实现让dbgrid接收到几十条纪录后就停止接收,开始显示,按一下翻页建后,县时下几十行纪录
。200分奉上。
 
查询时用一个参数来控制。想显示哪一页就显示哪一页。
在服务端做一个相应的存储过程。
 
要么按照 jsxjd 去做,要么缩小查询范围(比如实施分类查询),一次弄出几万条记录来,
不仅加重网络传输负荷,而且也让用户看花了眼啊
个人看法,别介意[:D]
 
赞同smallbs
有道理
 
可以用Developer Express Inc的控件包,其中的TdxDBGrid控件的edgoPartilLoad属性可以
控制接受的记录数。
 
不需要搞的那么复杂,你只要在KEYDOWN上加入一些触发时间来处理这个问题不就行了吗?
 
ExpressQuantumGrid 可以很好地解决这个问题:
The ExpressQuantumGrid can function in three unique modes:

1、LoadAllRecords mode.
2、Standard grid mode.
3、Partial load mode.

While in LoadAllRecords mode, the ExpressQuantumGrid reads all records from
a dataset to its internal buffer. Do not apply this mode to large tables
(> 15,000 records). Since all records are loaded into memory in this mode,
all features of the ExpressQuantumGrid are available for use including:

In Partial load mode, the ExpressQuantumGrid loads several records to its
inner buffer. The loaded records remain in memory until the dataset
associated with the ExpressQuantumGrid is refreshed. This partial mode is
suitable for large datasets. Similar to the standard grid mode, features
such as automatic sorting and automatic summary calculations are disabled.
However, in comparison with standard grid mode, partial load has some
advantages, namely:
1、It scrolls faster.
2、Multi-selection works properly.



。。。

 
如是三层, 可设TclientDataset.PacketRecords := 18 ;
 
多人接受答案了。
 
顶部