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

📄 huanyuan.pas

📁 delphi制作的校医院收费系统
💻 PAS
字号:
unit huanyuan;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls, DB, ADODB;

type
  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Edit1: TEdit;
    Button1: TButton;
    Button2: TButton;
    Bevel1: TBevel;
    Button3: TButton;
    ADOQuery1: TADOQuery;
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Edit1KeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button2Click(Sender: TObject);
begin
  application.Terminate;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
     if edit1.Text<>'13081052366' then
     begin
     showmessage('口令错误,登陆失败');
     button3.Enabled:=false;
     edit1.Text:='';
     end
     else
     button3.Enabled:=true;
end;

procedure TForm1.FormShow(Sender: TObject);
begin
    edit1.Text:='';
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
       ADOQuery1.Close;
       ADOQuery1.ConnectionString:=' Provider=SQLOLEDB.1;Persist Security ';
       ADOQuery1.ConnectionString:=ADOQuery1.ConnectionString+'Info=False;User ID=sa;Initial Catalog=master;Data Source=.;Use Procedure ';
       ADOQuery1.ConnectionString:=ADOQuery1.ConnectionString+'for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=TOND_MO;Use Encryption for Data=False;Tag with column collation when possible=False';

    try
        with  ADOQuery1 do
        begin
            close;
            sql.Clear;
            sql.Add('restore database data from disk = ''c:\Program Files\毕业设计\校医院收费管理系统\数据备份\data.bak''');
            execsql;
        end;
        showmessage('还原成功');
        except
        on e:exception do
        showmessage('还原失败');
        end;
        button3.Enabled:=false;
        button2.SetFocus;
end;

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
    if key=#13 then
        button1.Click;
end;

end.

⌨️ 快捷键说明

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