这个很简单的。
假设表名为TBALE1,字段名为:FIELD1,FIELD2,FIELD3,
则程序如下:
procedure TfmMain.BtnTextClick(Sender: TObject);
var
f:textfile;
s,s1:String;
begin
if not SaveDialog1.Execute
then
exit;
s1:=SaveDialog1.FileName;
AssignFile(f,s);
ReWrite(f);
with QryDo Do
try
Close;
Sql.Clear;
Sql.Add('select * from table1');
open;
while not eof do
begin
s:=Format('%s %s %s',
[FieldByName('field1').AsString,
FieldByName('field2').AsString,
FieldByName('field3').AsStyring]);
writeln(f,s);
next;
end;
except
end;
CloseFile(f);
ShowMessage('倒出数据成功!');
end;