unit4.~pas

来自「银行管理系统上机实验。 具有帐户添加」· ~PAS 代码 · 共 59 行

~PAS
59
字号
unit Unit4;

interface

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

type
  TForm4 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    Button1: TButton;
    ADOConnection1: TADOConnection;
    ADOQuery1: TADOQuery;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form4: TForm4;

implementation
    uses unit5;
{$R *.dfm}

procedure TForm4.Button1Click(Sender: TObject);
var  bb:string;
begin
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select * from account where account_number=:num');
adoquery1.Parameters[0].Value:=edit1.Text;
adoquery1.Open;
bb:=adoquery1.fieldbyname('pasword').AsString;
if strtoint(edit2.Text)=strtoint(bb)
  then
  begin
   form5.show;
  //close;
   end
  else
  ShowMessage('卡号或密码错误!');
end;

procedure TForm4.Button2Click(Sender: TObject);
begin
close;
end;

end.

⌨️ 快捷键说明

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