if Pos Error res then begin res for to Query FieldCount do res res Que

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
if (Pos('Error', res) = 0) then
begin
res := '';
for i := 0 to Query.FieldCount - 1 do
res := res + Query.Fields[i].FieldName + ';';
res := res + Chr(10);
while not Query.Eof do
begin
for i := 0 to Query.FieldCount - 1 do
res := res + Query.Fields[i].AsString + ';';
res := res + Chr(10);
Query.Next;
end;
end;
end