📄 sys_enter_mrplogin.pas
字号:
unit Sys_Enter_MrpLogin;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls,adodb;
type
TFrm_Sys_Enter_MrpLogin = class(TForm)
Label1: TLabel;
Label2: TLabel;
txtUID: TEdit;
txtPWD: TEdit;
btn_ok: TButton;
btn_cancel: TButton;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
procedure btn_okClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Frm_Sys_Enter_MrpLogin: TFrm_Sys_Enter_MrpLogin;
implementation
{$R *.DFM}
procedure TFrm_Sys_Enter_MrpLogin.Timer1Timer(Sender: TObject);
begin
Enabled := False;
ModalResult := btn_cancel.ModalResult;
Close;
end;
procedure TFrm_Sys_Enter_MrpLogin.btn_okClick(Sender: TObject);
var adoconnection:Tadoconnection;
userid,password:string;
begin
userid:=trim(txtuid.Text);
password:=trim(txtpwd.text);
try
adoconnection:=Tadoconnection.create(self);
with adoconnection do
begin
close;
loginprompt:=false;
connectionstring:='Provider=Microsoft.Jet.OLEDB.4.0;user id='+quotedstr(userid)+';Password='+quotedstr(password)+';Data Source='+extractfilepath(application.exename)+'\MrpACT.mdb;Persist Security Info=True';
try
connected:=true;
modalresult:=mrok;
except
showmessage('用户名或口令错误!请重新输入');
txtuid.SetFocus;
end;
end;
finally
adoconnection.free;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -