晕啊!
先看看帮助好不?
Indicates the total number of records in the recordset.
property RecordCount: Integer;
Description
Examine RecordCount to determine the total number of records in the recordset of
the dataset component. Applications might use this property with RecNo to iterate
through all the records in a dataset, though typically record iteration is handled
with calls to First, Last, MoveBy, and Prior using Eof and Bof to set the limits
of row traversing.
The dataset component must be active for RecordCount to provide a valid number.
Should ADO not be able to determine that actual number of rows, RecordCount will
return a value of negative one (-1).
In the example below, the RecNo and RecordCount properties of a TCustomDataSet
descendant are used to display the current record's number and the total number
of records in a TStatusBar component. This would be done in a handler for the
AfterScroll event of the ADO dataset component so that it is updated after each
row pointer movement.
StatusBar1.Panels[0].Text := 'Record ' + IntToStr(TCustomADODataSet(DataSet).RecNo) + ' of ' + IntToStr(TCustomADODataSet(DataSet).RecordCount);
Note: The number of rows indicated might be less than the total number of rows
in a table. This can happen when the rows retrieved as a recordset for a dataset
component are a conditional subset of the table.
数据库基本常识:
recordcount一般都是用于桌面数据库的,大型sql数据库之所以不提供这个功能是因为
开销太大,也就是说在你拿到第一笔数据的时候,数据库后台可能还在查询中。现在的
大数据库都是这么做的,以后就不清楚了,解决这个问题的办法一般都是用select count(*)
asp里面也有recordcount,连sql server一样无效
用循环!!!如果有1000000条,还不死了!
对delphi你还是有个小误解的,delphi不是只设计给傻瓜用的,而因为设计的太好已至于连傻瓜
都会用,我就搞不懂会vc的高手居然用不好。研究vcl同样可以很好的了解windows的运行机制。
.net先进吧,好吧,它的设计者和delphi的设计者是同一个人,.net的思想很多就是他在delphi
中的思想的延伸.
其实我就是想说一句,delphi是很先进的!