unit8.pas

来自「是关于SQL的一些程序 很好很经典的~大家又兴趣的可以学习下」· PAS 代码 · 共 54 行

PAS
54
字号
unit Unit8;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ComCtrls, Buttons;

type
  TForm8 = class(TForm)
    BitBtn1: TBitBtn;
    Savefile: TSaveDialog;
    returnmain: TBitBtn;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form8: TForm8;

implementation

{$R *.dfm}
uses Unit2;
procedure TForm8.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  application.Terminate;
end;

procedure TForm8.BitBtn1Click(Sender: TObject);
begin
  if savefile.Execute then //使用Save Dialog组件
  begin
    with  mydata.Query1 do
    begin
      close;
      with sql  do
      begin
      //添加进行数据库备份的SQL语句
        add('backup database 人事管理系统 to disk=:path');
        //获取从Save Dialog的路径名,然后将其赋值给SQL语句
        ParamByName('path').AsString:=savefile.FileName;
      end;
      execsql;
    end;
  end;
end;

end.
 

⌨️ 快捷键说明

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