⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 txt.pas

📁 本软件是小管家个人帐户管理系统 (ADO+ACCESS)
💻 PAS
字号:
unit txt;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, BusinessSkinForm, bsSkinCtrls, bsMessages, StdCtrls,
  bsSkinShellCtrls, Mask, bsSkinBoxCtrls;

type
  TForm_txt = class(TForm)
    bsBusinessSkinForm1: TbsBusinessSkinForm;
    bsSkinMessage1: TbsSkinMessage;
    bsSkinButton1: TbsSkinButton;
    bsSkinButton2: TbsSkinButton;
    bsSkinCheckRadioBox3: TbsSkinCheckRadioBox;
    bsSkinCheckRadioBox2: TbsSkinCheckRadioBox;
    bsSkinCheckRadioBox1: TbsSkinCheckRadioBox;
    bsSkinStdLabel1: TbsSkinStdLabel;
    bsSkinDirectoryEdit1: TbsSkinDirectoryEdit;
    procedure bsSkinButton2Click(Sender: TObject);
    procedure bsSkinButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form_txt: TForm_txt;

implementation
uses main,Mydatabase;
{$R *.dfm}
{------------------------------------------------------------------------------}
//关闭窗体
{------------------------------------------------------------------------------}
procedure TForm_txt.bsSkinButton2Click(Sender: TObject);
begin
close
end;
{------------------------------------------------------------------------------}
//导出数据
{------------------------------------------------------------------------------}
procedure TForm_txt.bsSkinButton1Click(Sender: TObject);
var
txt:tstrings;
i:integer;
temp,savename:string;
begin
if bsskindirectoryedit1.Text='' then begin
   bsskinmessage1.MessageDlg('请设置文件存放路径!',mtinformation,[mbok],0);
   exit;
end;
{------------------------------------------------------------------------------}
if  bsskincheckradiobox1.Checked =true then begin
    try
       temp:='';
       savename:='';
       savename:=bsskindirectoryedit1.Text+'\帐户信息.txt';
       txt:=tstringlist.Create ;
       for i:=0 to  datamodule1.ADOTable1.FieldCount-1 do
           temp:=temp+ datamodule1.ADOTable1.Fields[i].FieldName +#9; //读取字段名
       txt.Add(temp);
       txt.Add('');
       temp:='';
       datamodule1.ADOTable1.First ;
       while not  datamodule1.ADOTable1.Eof do begin
             for i:=0 to  datamodule1.ADOTable1.FieldCount -1 do
                 temp:=temp+ datamodule1.ADOTable1.Fields[i].AsString +#9;
             txt.Add(temp);
             temp:='';
             datamodule1.ADOTable1.Next ;
       end;
       txt.SaveToFile(savename);
    finally
       txt.Clear ;
       txt.Destroy ;
    end
end;
{------------------------------------------------------------------------------}
if  bsskincheckradiobox2.Checked =true then begin
    try
       temp:='';
       savename:='';
       savename:=bsskindirectoryedit1.Text+'\出帐信息.txt';
       txt:=tstringlist.Create ;
       for i:=0 to  datamodule1.ADOTable2.FieldCount-1 do
           temp:=temp+ datamodule1.ADOTable2.Fields[i].FieldName +#9; //读取字段名
       txt.Add(temp);
       txt.Add('');
       temp:='';
       datamodule1.ADOTable2.First ;
       while not  datamodule1.ADOTable2.Eof do begin
             for i:=0 to  datamodule1.ADOTable2.FieldCount-1 do
                 temp:=temp+ datamodule1.ADOTable2.Fields[i].AsString +#9;
             txt.Add(temp);
             temp:='';
             datamodule1.ADOTable2.Next ;
       end;
       txt.SaveToFile(savename);
    finally
       txt.Clear ;
       txt.Destroy ;
    end;
end;
{------------------------------------------------------------------------------}
if  bsskincheckradiobox3.Checked =true then begin
    try
       temp:='';
       savename:='';
       savename:=bsskindirectoryedit1.Text+'\入帐信息.txt';
       txt:=tstringlist.Create ;
       for i:=0 to  datamodule1.ADOTable3.FieldCount-1 do
           temp:=temp+ datamodule1.ADOTable3.Fields[i].FieldName +#9; //读取字段名
       txt.Add(temp);
       txt.Add('');
       temp:='';
       datamodule1.ADOTable3.First ;
       while not  datamodule1.ADOTable3.Eof do begin
             for i:=0 to  datamodule1.ADOTable3.FieldCount -1 do
                 temp:=temp+ datamodule1.ADOTable3.Fields[i].AsString +#9;
             txt.Add(temp);
             temp:='';
             datamodule1.ADOTable3.Next ;
       end;
       txt.SaveToFile(savename);
    finally
       txt.Clear ;
       txt.Destroy ;
       temp:='';
       savename:='';
    end;
end;
{------------------------------------------------------------------------------}
bsskinmessage1.MessageDlg('文件导出完毕!'+#13+bsskindirectoryedit1.Text,mtinformation,[mbok],0);
close;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -