Page 1 of 1

help understanding mydacs and getting a count from db tables

Posted: Mon 19 Jan 2009 11:35
by Thunder
I been trying to get a count from my db of my rooms in each lobby group in my db but am unsure on what component to use to get the command to find out the count

am doing the following in the MyCommand but i dont no if that is the correct component to use?

Code: Select all

   Command.SQL.Text := ('select count(*) as room_count from groups left join rooms on groups.n = rooms.id where groups.n = ' + IntToStr(r));
   Command.Execute;
can any one help me ?

thanks

Posted: Mon 19 Jan 2009 14:16
by Dimon
You can use the TMyQuery component for this purpose.

Code: Select all

MyQuery.SQL.Text := ...
MyQuery.Execute;