📄 gaimm.pas
字号:
unit gaimm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, StdCtrls;
type
TForm3 = class(TForm)
Button2: TButton;
Button1: TButton;
Edit3: TEdit;
Label3: TLabel;
Label2: TLabel;
Edit2: TEdit;
Edit1: TEdit;
Label1: TLabel;
ADOQuery1: TADOQuery;
ADOConnection1: TADOConnection;
DataSource1: TDataSource;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
{$R *.dfm}
procedure TForm3.Button1Click(Sender: TObject);
var
pw:string;
begin
if edit1.Text='' then
begin
application.MessageBox('用户名为空,请输入用户名!','密码更改失败',mb_ok)
end
else
begin
adoquery1.Close;
adoquery1.Active:=false;
adoquery1.Connection:=gaimm.Form3.ADOConnection1;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select * from 人员表 ');
adoquery1.SQL.Add('where 姓名='''+edit1.Text+'''');
adoquery1.Active:=true;
adoquery1.Open;
pw:=adoquery1.FieldByName('密码').AsString;
if edit2.Text=pw then
begin
gaimm.Form3.ADOQuery1.Edit;
gaimm.Form3.ADOQuery1.FieldValues['密码']:=edit3.Text;
gaimm.Form3.ADOQuery1.Post;
edit1.Text:='';
edit2.Text:='';
edit3.Text:='';
gaimm.Form3.Close;
application.MessageBox('修改密码成功!','密码更改成功',mb_ok)
end
else
begin
application.MessageBox('原密码输入错误,请重新输入','密码错误',mb_ok);
end;
edit1.Text:='';
edit2.Text:='';
edit3.Text:='';
end;
end;
procedure TForm3.Button2Click(Sender: TObject);
begin
gaimm.Form3.Close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -