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

📄 添加管理员.frm

📁 VB的图书馆管理系统.管理员的帐号和密码都是
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form10 
   Caption         =   "添加管理员"
   ClientHeight    =   2835
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4335
   LinkTopic       =   "Form1"
   ScaleHeight     =   2835
   ScaleWidth      =   4335
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   375
      Left            =   2280
      TabIndex        =   7
      Top             =   2160
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   375
      Left            =   720
      TabIndex        =   6
      Top             =   2160
      Width           =   1335
   End
   Begin VB.TextBox Text3 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   2040
      PasswordChar    =   "*"
      TabIndex        =   5
      Top             =   1560
      Width           =   1815
   End
   Begin VB.TextBox Text2 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   2040
      PasswordChar    =   "*"
      TabIndex        =   3
      Top             =   960
      Width           =   1815
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   2040
      TabIndex        =   1
      Top             =   360
      Width           =   1815
   End
   Begin VB.Label Label3 
      Caption         =   "确认密码"
      Height          =   375
      Left            =   480
      TabIndex        =   4
      Top             =   1560
      Width           =   1335
   End
   Begin VB.Label Label2 
      Caption         =   "密码"
      Height          =   375
      Left            =   480
      TabIndex        =   2
      Top             =   960
      Width           =   1335
   End
   Begin VB.Label Label1 
      Caption         =   "用户号码"
      Height          =   375
      Left            =   480
      TabIndex        =   0
      Top             =   360
      Width           =   1335
   End
End
Attribute VB_Name = "Form10"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim ac As String
Dim ar As New ADODB.Recordset
Dim acd  As New ADODB.Connection
  acd.Open "provider=Microsoft.Jet.OLEDB.4.0; data source=" & App.Path & "\图书馆.mdb"
If Trim(Text1.Text) = "" Then
  MsgBox "用户名不能为空,请重新输入"
    Text1.SetFocus
   Else
      ac = "select * from 密码"
      ar.Open ac, acd, adOpenKeyset, adLockPessimistic
      While (ar.EOF = False)
         If Trim(ar.Fields(0)) = Trim(Text1.Text) Then
           MsgBox "用户名已经存在,请重新输入用户名"
           Text1.SetFocus
           Text1.Text = ""
           Text2.Text = ""
           Text3.Text = ""
          Exit Sub
         Else
         ar.MoveNext
         End If
       Wend
      If Trim(Text2.Text) <> Trim(Text3.Text) Then
        MsgBox "两次输入的密码不一致", vbOKOnly + vbExclamation
        Text2.SetFocus
        Text2.Text = ""
        Text3.Text = ""
       Exit Sub
      Else
        ar.AddNew
        ar.Fields(0) = Text1.Text
        ar.Fields(1) = Text2.Text
        ar.Fields(2) = "管理员"
        ar.Update
        MsgBox "添加管理员成功"
        Me.Hide
      End If
    End If

End Sub

Private Sub Command2_Click()
Unload Me
End Sub

⌨️ 快捷键说明

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