> 2. This can be dangerous if the query is large as depending on the
drivers you are using > the only way for Delphi to find the number of
records is for it to scan the query from start > to finish
Paradox holds the number of records in a table/query thus using
RecordCount is fairly safe/quick (though still not recommended for
future portability) .
For most (all?) other DB's it is an bad idea as with DB's like Access,
RecordCount is only valid if you do a 'query.first' ... 'query.last'
first (which is slow with large result sets).
Remember that in a multi-user DB enviroment the record count can change
between getting the count and using it....
>Is there any easy way to know how many records a select query has
returned.
You could also do a 'select ... Count()' query to check the number of
records before you go on to do any processing, but you are best to wrap
'while not eof' around all result set processing anyway.
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz