Delphi 7 - How to list SQL query content inside a Memo?

I need to list the contents of the following query inside a Memo:
qry.SQL.Add('SELECT message FROM inbox WHERE ID = 2');
qry.ExecSQL;

How can I do this?

Thanks.

John86aAsked:
Who is Participating?
 
Ephraim WangoyaConnect With a Mentor Commented:
Use this
qry.SQL.Add('SELECT message FROM inbox WHERE ID = 2');
qry.Active := True;

memo1.lines.Add(qry.FieldByName('message').AsString);

Open in new window

0
 
John86aAuthor Commented:
Thank you again, that works well.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.