Board index » delphi » Help: How do you know when TQuery is done with it's fetch

Help: How do you know when TQuery is done with it's fetch

When using TQuery, what message handler is used to determine that the SQL
was successfully executed and the rowset was returned?

 

Re:Help: How do you know when TQuery is done with it's fetch


Quote
>When using TQuery, what message handler is used to determine that the SQL
>was successfully executed and the rowset was returned?

You will need to check the EdbEngineError object to find if the query
fails.  To find if it has returned any rows you can check the BOF and
EOF properties.  If they are both true there where no records
returned.

Try
    query1.active := True;
   if not  (query1.Eof and Query1.Bof) then begin
    {Query succeeded in returning records}

  end;
Except
  On e:EdbEngineError Do begin
 {Query failed to execute}
 {check E.message and e.errors}
  end;
end;
--
Brian Bushay (TeamB)
Bbus...@DataGuidance.com

Other Threads