Сделал!!!
Только теперь надо объединить в цикл ADOQuary1 и 2, а вот как это сделать-вопрос
Код HTML:
procedure TForm1.Button3Click(Sender: TObject);
var
i, j:integer;
st:string;
begin
with StringGrid1 do
Cells[0,1]:='DEMO';
with StringGrid1 do
Cells[0,2]:='DEVELOP';
with StringGrid1 do
Cells[1,0]:='Count1';
with StringGrid1 do
Cells[2,0]:='Count2';
for j:=1 to StringGrid1.RowCount-1 do
begin
st:=StringGrid1.Cells[1,j];
ADOQuery1.SQL.Clear;
ADOQuery1.Close;
ADOQuery1.SQL.Add('select count(template_id) as f1 from os_eqm.devices where template_id <>0');
ADOQuery1.Open;
with StringGrid1 do
Cells[1,1]:=adoquery1.Fields[0].AsString;
ADOQuery2.SQL.Clear;
ADOQuery2.Close;
ADOQuery2.SQL.Add('select count(def_monitoring_type)from devices_active where nvl(def_monitoring_type,0) <> 0');
ADOQuery2.Open;
with StringGrid1 do
Cells[2,1]:=ADOQuery2.Fields[0].AsString;
end;
end;