var
SaveDlg:TSaveDialog;
hFile:TextFile;
i:integer;
begin
SaveDlg:=TSaveDialog.create(self);
if SaveDlg.Execute then
EditSaveDir.Text:=SaveDlg.FileName;
assignfile(hFile,EditSaveDir.Text);
ReWrite(hFile);
with adoquery1 do begin
first;
for i:= 0 to Fieldcount-1 do
write(hFile,Fields[i].fieldname,'|');
writeln(hFile);
while not eof do begin
for i:=0 to Fieldcount-1 do
write(hFile,Fields[i].asstring,'|');
writeln(hFile);
Next;
end;
CloseFile(hFile);
end;
转载于:https://www.cnblogs.com/kylskjb/archive/2009/12/08/1619825.html