📄 tjyh.pas
字号:
unit TJYH;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, StdCtrls;
type
TTJYHForm = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
Label3: TLabel;
Label5: TLabel;
Label2: TLabel;
Edit2: TEdit;
Edit1: TEdit;
Edit3: TEdit;
ComboBox1: TComboBox;
Button1: TButton;
Button2: TButton;
Button3: TButton;
ADOTable1: TADOTable;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
TJYHForm: TTJYHForm;
implementation
{$R *.dfm}
procedure TTJYHForm.Button1Click(Sender: TObject);
begin
ADOTable1.Open;
if not ADOTable1.Locate('YHM',edit3.Text,[loPartialKey]) then// 在用户管理表中查找该用户名
begin //不存在 则:
if (edit1.Text = edit2.Text) and (ComboBox1.Text <> '') then //密码确认是否一致 并且 权限不为空
begin
ADOTable1.InsertRecord([edit3.Text,edit2.Text,ComboBox1.Text]);
Application.MessageBox('用户添加成功!','提示');
end else
Application.MessageBox('密码或用户权限有误!','提示');
end else //已经存在 提示
Application.MessageBox('该用户已经存在!!','提示');
ADOTable1.Close;
end;
procedure TTJYHForm.Button2Click(Sender: TObject);
begin
CLOSE;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -