Select count (*) from ... : how to

Some time ago someone asked how to get the
result of a query like "select count (*) from ..
into Delphi. I needed it too today.

Here is how I do it :

1. Paint a query, and put your select
    statement in the Strings property.

2. Right-click to enter the fields editor
    click "ADD", and select (count(*)) from the
    field list (the only field)

3. Paint a datasource, connect to the query

4. Paint a dbedit, connect to the datasource,
    and select (count(*)) as the "Datafield"

5. Put a "Query.Open" statement somewhere
    in your code and the result of the "select count(*)
    will appear in the dbedit.

It works for me (Delphi C/S 1.02 on Informix Online 5).
I hope I am not too late in answering  your question.

Danny Heijl.

Bisdomplein 3
9000 Gent