1.  MyQuery.RecordCount tells you the number of records returned
 
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
 
3.  Eof will not return true if you return one record.  the following code works in the situation where one record is returned
 
MyQuery.Open;
While Not MyQuery.Eof do
begin
  // do some processing here
 
  MyQuery.Next;
end;
 
Eof will only be true when you open a query if 0 records are returned.
 
Please note... these assumptions about EOF are based on the databases and drivers that **I** have used. 
 
Yours
Jo Pitts
Software Development Manager
Telephony Video Data
http://www.tvd.co.nz
+64 9 376 6016 [Phone]
+64 9 376 6017 [Fax]
+64 21 894 883 [Mobile]
-----Original Message-----
From: Maurice Butler <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Date: Sunday, December 13, 1998 12:53 PM
Subject: [DUG]: Tquery

Hi,
 
Is there any easy way to know how many records a select query has returned.
 
The problem I have is I was doing a while on EOF but if only one record is returned the EOF is true and my while code does not execute.
 
Thanks
--------------------------------------------------------------------------------
Maurice Butler     Like Magic Ltd    (025) 273 9248

Reply via email to