.. maybe it will work in that way
Best regards
Klaus
Delphi-Quellcode:
procedure fn1(
var sl:TStringList);
var
...
qryPMV := TQuery.Create(
nil);
qryPMV.DatabaseName := '
DB';
qryPMV.Close;
qryPMV.Sql.Clear;
qryPMV.Sql.Add('
SELECT Distinct column1 PMV ');
qryPMV.Sql.Add('
FROM MMV_DB ');
qryPMV.Sql.Add('
Order by PMV ');
strSQL := qryPMV.Sql.GetText;
qryPMV.Open;
if not (qryPMV.bof
and qryPMV.eof)
then
begin
strHeader := '
PM_guys';
WHILE not qryPMV.EOF
do
begin
strOutputZeile := '
';
strPPV := strHeader + cTrenner + qryPMV.FieldByName('
PM_VERANTWORTLICHER').AsString;
strPPV := StringReplace(strPPV, cCRLF, cDelimiter, 1);
sl.add(strPPV);
qryPMV.next;
end;
end;