Lazarus中文社区

 找回密码
 立即注册(注册审核可向QQ群索取)

QQ登录

只需一步,快速开始

Lazarus IDE and 组件 下载地址版权申明
查看: 4457|回复: 1

sqldb组件里的Tsqlquery的packetrecords属性的作用?

[复制链接]

该用户从未签到

发表于 2010-8-17 07:25:55 | 显示全部楼层 |阅读模式
sqldb组件里的TSQLQuery的packetrecords属性的作用是什么?
默认值位10.
在lazarus之前的版本里的sqldb,TSQLQuery执行查询时(select),只返回10条记录。
回复

使用道具 举报

该用户从未签到

发表于 2010-8-27 22:53:31 | 显示全部楼层
看起來是為了效率的考量, 我只知要取回正確的 recordcount 值, 要把這個屬性設成 -1

Why does TSQLQuery.RecordCount always return 10?

To count the records in a datase, use '.RecordCount'. However, notice that '.RecordCount' shows the number of records that is already loaded from the server. Sqldb does not read all records when opening TSQLQuery by default, only the first 10. Only when the eleventh record is accessed then the next set of 10 records is loaded. Using '.Last' all records will be loaded.

When you want to know the real number of records on the server you can first call '.Last' and then call '.RecordCount'. An alternative is available. The number of records returned by the server is set by the '.PacketRecords' property. The default value is 10, if you make it -1 then all records will be loaded at once.
回复 支持 反对

使用道具 举报

*滑块验证:

本版积分规则

QQ|手机版|小黑屋|Lazarus中国|Lazarus中文社区 ( 鄂ICP备16006501号-1 )

GMT+8, 2025-5-2 22:34 , Processed in 0.028179 second(s), 11 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表