Prueba con este otro ejemplo a ver si es lo que pides:
Código Delphi
[-]
implementation
{$R *.DFM}
procedure QueryToCSV(QueryName:TQuery);
var
i,j: integer;
s: string;
theStringList: Tstringlist;
begin
s:='';
theStringList:=TStringList.Create;
with QueryName do
begin
try
Active:=True;
except
showmessage('No puedo abrir la consulta '+ Name);
end;
for j:=0 to (RecordCount-1) do
begin
s:='';
for i:=0 to (FieldCount-1) do
begin
s:=s+(Fields[i].AsString)+',';
end;
theStringList.add(s);
Next;
end;
theStringList.savetofile('D:\MiTxt.csv');
Showmessage('El Archivo MiTxt.CSV se creó con exito.');
close;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
QueryToCSV(Query1);
end;
Un Saludo