procedure TForm1.Button1Click(Sender: TObject);
var
strMid: TStringList;
i:integer;
begin
i:=0;
if fileDiag.Execute then
begin
strMid:=TstringList.Create;
while not gzQry.eof do
begin
i:=i+1;
strMid.Add(gzQry.fieldByName('xm').AsString+'|'+
gzQry.fieldByName('zg').AsString+'|'+
gzQry.fieldByName('jg').AsString+'|'+
gzQry.fieldByName('jc').AsString+'|');
gzQry.Next;
end;
strMid.SaveToFile(fileDiag.filename);
showmessage('ok,倒了'+intToStr(i) +'条记录');
end;
end;
编译通过,在delphi5下