Query empty??? 
Author Message
 Query empty???

Quote:

> How to determine if a query is empty or have one record?
> I dont want to use  RecordCount because I have had a
> lot of problem with it.

> (still using delphi 1.0)

> Cry for help...
> Tom Hammarberg

You could check to see if Bof and Eof are true - i.e. no records:

        if Query1.Bof and Query1.Eof then {No records returned}

or do a manual count if you need to know the precise number of records returned:

        Count := 0;

        while not Query1.Eof do
        begin
            Inc(Count, 1);
            Query1.Next;
        end;



Sun, 20 Dec 1998 03:00:00 GMT  
 Query empty???

How to determine if a query is empty or have one record?
I dont want to use  RecordCount because I have had a
lot of problem with it.

(still using Delphi 1.0)

Cry for help...
Tom Hammarberg



Mon, 21 Dec 1998 03:00:00 GMT  
 Query empty???

Quote:


>Subject: Query empty???
>Date: Thu, 04 Jul 1996 01:50:40 GMT
>How to determine if a query is empty or have one record?
>I dont want to use  RecordCount because I have had a
>lot of problem with it.
>(still using Delphi 1.0)
>Cry for help...
>Tom Hammarberg

I ususally use:

if MyTable.Bof and MyTable.Eof then
...

and i guess you could inherit from TTable (or TQuery or whatever) and add an
IsEmpty method which did this...

_|\____/|___/~|__|~|_____________________________________________
 | \  / |  /  |  | |    "Welcome to heaven. Here's your harp."
 |  \/  | / / |__| |__  "Welcome to hell. Here's your accordion."
 |      |/ /| |__| | /  -----------------------------------------

=|_|==|__/==\_|==|_/=============================================



Mon, 21 Dec 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Records where there should be an empty query?

2. SQL.Open *no* error with empty query?

3. empty field in query

4. !!! help - date query and empty foreign key insertion

5. Empty Table not the same DB desktop empty

6. How to check for an empty query result set?

7. Can I create Paradox table from dynamic SQL-query ? (message body is empty)

8. Query against empty table causes "Invalid Floating Point"...

9. Empty Table - Table in use

10. Problems with ACCESS 97 and empty strings

11. how can i tell is detail grid is empty

12. Reportsmith and Empty lines in labels

 

 
Powered by phpBB® Forum Software