procedure TForm1.StringGrid1Click(Sender: TObject);
var
i, j: Integer;
begin
with Query1 do begin
Open;
First;
StringGrid1.ColCount:= FieldCount+1;
StringGrid1.RowCount:= RecordCount+1;
for i:=0 to RecordCount-1 do
begin
for j:=0 to FieldCount-1 do
begin
StringGrid1.Cells[j+1,i+1]:= Fields[j].AsString;
end;
Next;
end;
end;
end;