Mega Code Archive

 
Categories / Delphi / ADO Database
 

Tablodan stringgride export

Function Export_Table_To_StringGrid(Table: TTable; StringGrid: TStringGrid): Boolean; Var Ix, Iy: Integer; Begin With Table Do Begin For Iy:= 0 To FieldCount - 1 Do StringGrid.Cols[Iy].Text:= FieldDefs.Items[Iy].Name; First; For Ix:= 1 To RecordCount Do Begin For Iy:= 0 To FieldCount - 1 Do StringGrid.Cells[Iy, Ix]:= FieldByName(FieldDefs.Items[Iy].Name).AsString; Next; End; End; Result:= True; End;