ADO Database Delphi

(* this code will help you copy data from selected rows in a Datagrid to a clipboard*)
uses
Clipbrd;
var
i, j: Integer;
sData: string;
SysClip : TClipBoard;
begin
SysClip := TClipBoard.Create;
//used to create to copy the column Header
for i:=0 to DBGrid1.SelectedRows.Count do begin
sData:=sData+ uppercase(DBGrid1.Fields[i].DisplayName) ;
if i<>DBGrid1.SelectedRows.Count then
sData:=sData+ ', '+#09; //tab
end;
sData:=sData+#13#10; //carriage return
if DBGrid1.SelectedRows.Count>0 then
with DBGrid1.DataSource.DataSet do
for i:=0 to DBGrid1.SelectedRows.Count-1 do
begin
//goto the bookmark of the seleced row to copy its content
GotoBookmark(pointer(DBGrid1.SelectedRows.Items[i]));
for j := 0 to FieldCount-1 do
begin
sData:=sData+Fields[j].AsString ;
if (j>0) then
sData:=sData+', '+#09; //tab
end;
sData:=sData+#13#10; //carriage return
end;
SysClip.AsText := sData; //copy data to clipboard
SysClip.Destroy;
end;