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

📄 frmadduser.frm

📁 大学好的可设内容
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmadduser 
   BackColor       =   &H00C0E0FF&
   Caption         =   "增加用户"
   ClientHeight    =   3090
   ClientLeft      =   5295
   ClientTop       =   5565
   ClientWidth     =   4680
   Icon            =   "frmadduser.frx":0000
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   3090
   ScaleWidth      =   4680
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3960
      TabIndex        =   9
      Top             =   3240
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2160
      TabIndex        =   8
      Top             =   3240
      Width           =   975
   End
   Begin VB.ComboBox Combol 
      BackColor       =   &H80000018&
      BeginProperty DataFormat 
         Type            =   1
         Format          =   "guest"
         HaveTrueFalseNull=   0
         FirstDayOfWeek  =   0
         FirstWeekOfYear =   0
         LCID            =   2052
         SubFormatType   =   0
      EndProperty
      Height          =   300
      ItemData        =   "frmadduser.frx":2C14A
      Left            =   3360
      List            =   "frmadduser.frx":2C14C
      TabIndex        =   0
      Text            =   "guest"
      Top             =   2520
      Width           =   1575
   End
   Begin VB.TextBox Text3 
      BackColor       =   &H80000018&
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   3360
      PasswordChar    =   "*"
      TabIndex        =   7
      Top             =   1800
      Width           =   1575
   End
   Begin VB.TextBox Text2 
      BackColor       =   &H80000018&
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   3360
      PasswordChar    =   "*"
      TabIndex        =   6
      Top             =   1080
      Width           =   1575
   End
   Begin VB.TextBox Text1 
      BackColor       =   &H80000018&
      Height          =   375
      Left            =   3360
      TabIndex        =   5
      Top             =   480
      Width           =   1575
   End
   Begin VB.Line Line5 
      BorderColor     =   &H00C00000&
      X1              =   1200
      X2              =   5760
      Y1              =   360
      Y2              =   360
   End
   Begin VB.Label Label5 
      Caption         =   "    请按提示进行操作"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   375
      Left            =   1200
      TabIndex        =   10
      Top             =   0
      Width           =   4575
   End
   Begin VB.Line Line4 
      BorderColor     =   &H00C00000&
      X1              =   5760
      X2              =   5760
      Y1              =   360
      Y2              =   3720
   End
   Begin VB.Line Line3 
      BorderColor     =   &H00C00000&
      X1              =   1200
      X2              =   1200
      Y1              =   360
      Y2              =   3720
   End
   Begin VB.Line Line2 
      BorderColor     =   &H00C00000&
      X1              =   1200
      X2              =   5760
      Y1              =   3720
      Y2              =   3720
   End
   Begin VB.Line Line1 
      X1              =   1200
      X2              =   5760
      Y1              =   360
      Y2              =   360
   End
   Begin VB.Label Label4 
      Caption         =   "选择权限"
      Height          =   255
      Left            =   2160
      TabIndex        =   4
      Top             =   2520
      Width           =   1095
   End
   Begin VB.Label Label3 
      Caption         =   "确认密码"
      Height          =   255
      Left            =   2160
      TabIndex        =   3
      Top             =   1920
      Width           =   1095
   End
   Begin VB.Label Label2 
      Caption         =   "输入密码"
      Height          =   255
      Left            =   2160
      TabIndex        =   2
      Top             =   1200
      Width           =   1095
   End
   Begin VB.Label Label1 
      Caption         =   "输入用户名"
      Height          =   255
      Left            =   2160
      TabIndex        =   1
      Top             =   600
      Width           =   1095
   End
End
Attribute VB_Name = "frmadduser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False




Private Sub Command1_Click()
Dim sql As String
Dim rs_add As New ADODB.Recordset
If Trim(Text1.Text) = "" Then
MsgBox "用户不能为空!", vbOKOnly + vbExclamation, ""
Exit Sub
Text1.SetFocus
Else
sql = "select * from 系统管理"
rs_add.Open sql, conn, adOpenKeyset, adLockPessimistic
While (rs_add.EOF = False)
If Trim(rs_add.Fields(0)) = Trim(Text1.Text) Then
MsgBox "已有这个用户", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""

Exit Sub
Else
rs_add.MoveNext
End If
Wend
If Trim(Text2.Text) <> Trim(Text3.Text) Then
MsgBox "两次密码不一致!", vbOKOnly + vbExclamation, ""
Text2.SetFocus
Text2.Text = ""
Text3.Text = ""
Exit Sub
ElseIf Trim(Combol.Text) <> "system" And Trim(Combol.Text) <> "guest" Then
MsgBox "请选择正确的用户权限", vbOKOnly + vbExclamation, ""
Combol.SetFocus
Combol.Text = ""
Exit Sub
Else
rs_add.AddNew
rs_add.Fields(0) = Text1.Text
rs_add.Fields(1) = Text2.Text
rs_add.Fields(2) = Combol.Text
rs_add.Update
rs_add.Close

MsgBox "添加用户成功!", vbOKOnly + vbExclamation, ""
Unload Me
End If
End If
End Sub
Private Sub Command2_Click()

frmadduser.Hide
End Sub

⌨️ 快捷键说明

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