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

📄 frmadduser.frm

📁 VB类实现学生信息管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmAdduser 
   Caption         =   "添加用户"
   ClientHeight    =   3360
   ClientLeft      =   45
   ClientTop       =   345
   ClientWidth     =   3870
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   3360
   ScaleWidth      =   3870
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   492
      Left            =   1920
      TabIndex        =   7
      Top             =   2520
      Width           =   972
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确认"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   492
      Left            =   600
      TabIndex        =   6
      Top             =   2520
      Width           =   972
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   492
      IMEMode         =   3  'DISABLE
      Index           =   2
      Left            =   1680
      PasswordChar    =   "*"
      TabIndex        =   3
      Top             =   1800
      Width           =   1572
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   492
      IMEMode         =   3  'DISABLE
      Index           =   1
      Left            =   1680
      PasswordChar    =   "*"
      TabIndex        =   2
      Top             =   1080
      Width           =   1572
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   492
      Index           =   0
      Left            =   1680
      TabIndex        =   0
      Top             =   360
      Width           =   1572
   End
   Begin VB.Label Label3 
      Caption         =   "请确认密码"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   120
      TabIndex        =   5
      Top             =   1800
      Width           =   1452
   End
   Begin VB.Label Label2 
      Caption         =   "请输入密码"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   120
      TabIndex        =   4
      Top             =   1080
      Width           =   1332
   End
   Begin VB.Label Label1 
      Caption         =   "请输入用户名"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   120
      TabIndex        =   1
      Top             =   480
      Width           =   1452
   End
End
Attribute VB_Name = "frmAdduser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdok_Click()
    
    
  
    Dim add_user As user
    
    
    
    If Trim(Text1(0).Text) = "" Then
        MsgBox "请输入用户名称!", vbOKOnly + vbExclamation, "警告"
        Exit Sub
        Text1(0).SetFocus
    Else
       Set add_user = New user
       
       add_user.user_Id = Trim(Text1(0).Text)
       add_user.query
       
       If add_user.State = 1 Then
                MsgBox "用户已经存在,请重新输入用户名!", vbOKOnly + vbExclamation, "警告"
                Text1(0).SetFocus
                Text1(0).Text = ""
                Text1(1).Text = ""
                Text1(2).Text = ""
                Exit Sub
       End If
       
       If add_user.State = 2 Then 'no user exist
            If Trim(Text1(1).Text) <> Trim(Text1(2).Text) Then
               MsgBox "两次输入密码不一样,请确认!", vbOKOnly + vbExclamation, "警告"
               Text1(1).SetFocus
               Text1(1).Text = ""
               Text1(2).Text = ""
               Exit Sub
        
            Else
                If Text1(1).Text = "" Then
                   MsgBox "密码不能为空!", vbOKOnly + vbExclamation, "警告"
                   Text1(1).SetFocus
                   Text1(1).Text = ""
                   Text1(2).Text = ""
                Else
                   add_user.user_pwd = Trim(Text1(1).Text)
                   add_user.user_des = 1
                   add_user.insert
                   If InStr(add_user.oper_flag, "ok") > 0 Then
                        Me.Hide
                        MsgBox "添加用户成功!", vbOKOnly + vbExclamation, "添加用户"
                   Else
                        MsgBox "添加用户失败!", vbOKOnly + vbExclamation, "添加用户"
                   End If
                End If
            End If
        End If ' If add_user.state = 2 Then
      
    End If
    
    Set add_user = Nothing
    Unload Me
End Sub

⌨️ 快捷键说明

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