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

📄 frmuseradd.frm

📁 用vb实现的图书管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmUserAdd 
   Caption         =   "添加用户"
   ClientHeight    =   4980
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   5655
   LinkTopic       =   "Form3"
   ScaleHeight     =   4980
   ScaleWidth      =   5655
   StartUpPosition =   3  '窗口缺省
   Begin VB.ComboBox cobPower 
      Height          =   300
      ItemData        =   "frmUserAdd.frx":0000
      Left            =   2280
      List            =   "frmUserAdd.frx":000D
      TabIndex        =   9
      Text            =   "借阅操作员"
      Top             =   3000
      Width           =   2055
   End
   Begin VB.TextBox txtPassword 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   2280
      PasswordChar    =   "*"
      TabIndex        =   8
      Top             =   1320
      Width           =   2055
   End
   Begin VB.TextBox txtPasswordConfirm 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   2280
      PasswordChar    =   "*"
      TabIndex        =   7
      Top             =   2160
      Width           =   2055
   End
   Begin VB.TextBox txtUser 
      Height          =   375
      Left            =   2280
      TabIndex        =   6
      Top             =   480
      Width           =   2055
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   495
      Left            =   3000
      TabIndex        =   5
      Top             =   3960
      Width           =   1455
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   495
      Left            =   960
      TabIndex        =   4
      Top             =   3960
      Width           =   1455
   End
   Begin VB.Label Label4 
      Caption         =   "登陆权限"
      Height          =   375
      Left            =   600
      TabIndex        =   3
      Top             =   3000
      Width           =   975
   End
   Begin VB.Label Label3 
      Caption         =   "确认密码"
      Height          =   375
      Left            =   600
      TabIndex        =   2
      Top             =   2160
      Width           =   975
   End
   Begin VB.Label Label2 
      Caption         =   "密码"
      Height          =   375
      Left            =   600
      TabIndex        =   1
      Top             =   1320
      Width           =   975
   End
   Begin VB.Label Label1 
      Caption         =   "用户名"
      Height          =   375
      Left            =   600
      TabIndex        =   0
      Top             =   480
      Width           =   975
   End
End
Attribute VB_Name = "frmUserAdd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Change()

End Sub

Private Sub Command1_Click()
Dim conn As ADODB.Connection
Dim rs As New ADODB.Recordset
Dim sql As String
Dim N As Boolean
N = True
If Trim(txtUser.Text) = "" Then
MsgBox "用户名不能为空", vbOKOnly + vbExclamation, ""
txtUser.SetFocus
N = False
End If
If Trim(txtPassword.Text) = "" Then
MsgBox "密码不能为空", vbOKOnly + vbExclamation, ""
txtPassword.SetFocus
N = False
End If
If Trim(txtPasswordConfirm.Text) <> Trim(txtPassword.Text) Then
MsgBox "密码不一致", vbOKOnly + vbExclamation, ""
txtPasswordConfirm.SetFocus
N = False
End If



If N = False Then
MsgBox "添加用户信息失败", vbOKOnly
Else
Set conn = New ADODB.Connection
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=book.mdb;Persist Security Info=False"
conn.Open
sql = "select*from UserInfo where UserName ='" + txtUser.Text + "'"
rs.Open sql, conn, adOpenKeyset, adLockPessimistic

If rs.EOF Then
  rs.AddNew
  rs.Fields(1) = Trim(txtUser.Text)
  rs.Fields(2) = Trim(txtPassword.Text)
  rs.Fields(3) = Trim(cobPower.Text)
  rs.Update
  MsgBox "添加用户成功", vbOKOnly, ""
  rs.Close
  Else
  MsgBox "用户名重复!", vbOKOnly + vbExclamation, ""
  txtUser.SetFocus
  txtUser.Text = ""
  rs.Close
  End If
  End If
  
End Sub

Private Sub Command2_Click()
Unload Me

End Sub

⌨️ 快捷键说明

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