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

📄 code.~pas

📁 一个很简单的三层数据库程序,包括毕业论文, 因为简单,所以容易供参考学习!
💻 ~PAS
字号:
unit code;

interface

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

type
  TFm_code = class(TForm)
    Label1: TLabel;
    Edit1: TEdit;
    Label2: TLabel;
    Label3: TLabel;
    Edit3: TEdit;
    Button1: TButton;
    Edit2: TEdit;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Fm_code: TFm_code;

implementation

uses data;

var
sta:boolean;

{$R *.dfm}

procedure TFm_code.Button1Click(Sender: TObject);
begin
if sta=false then
begin
   if ((edit1.Text='') or (edit1.Text=null)) then
   application.MessageBox('请输入图书证号','输入错误',
                     mb_iconinformation + mb_defbutton1);
   if ((edit2.Text='') or (edit2.Text=null)) then
   application.MessageBox('请输入密码','输入错误',
                     mb_iconinformation + mb_defbutton1);
   if  ((edit3.text='') or (edit2.text=null)) then
   application.MessageBox('请输入新密码','输入错误',
                     mb_iconinformation + mb_defbutton1);
   fm_data.Cd_card.Close;
   fm_data.Cd_card.CommandText:='select * from cards where cardNo='+edit1.Text+' and code='+edit2.text;
   fm_data.Cd_card.Execute;
   fm_data.Cd_card.Open;

   if fm_data.Cd_card.RecordCount>0 then
   begin
       fm_data.Cd_card.Edit;
       fm_data.Cd_card.fieldbyname('code').Value:=edit3.Text;
       fm_data.Cd_card.ApplyUpdates(-1);
       showmessage('密码修改成功');
   end
   else
      showmessage('图书证或密码有错误');
end;

end;

procedure TFm_code.FormCreate(Sender: TObject);
begin
sta:=false;
end;

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

end.

⌨️ 快捷键说明

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