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

📄 frmnewuser.frm

📁 本需求规格说明书是为了开发《飞机订票系统》而编写的
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmNewUser 
   BackColor       =   &H80000007&
   Caption         =   "Form1"
   ClientHeight    =   1890
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6855
   LinkTopic       =   "Form1"
   ScaleHeight     =   1890
   ScaleWidth      =   6855
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox txt 
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   300
      IMEMode         =   3  'DISABLE
      Left            =   2040
      TabIndex        =   3
      Top             =   120
      Width           =   2415
   End
   Begin VB.ComboBox cmb 
      Height          =   300
      Left            =   2040
      TabIndex        =   2
      Top             =   840
      Width           =   2415
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "取 消"
      Height          =   345
      Left            =   3240
      TabIndex        =   1
      Top             =   1440
      Width           =   975
   End
   Begin VB.CommandButton cmdFinally 
      Caption         =   "完 成"
      Default         =   -1  'True
      Height          =   345
      Left            =   1920
      TabIndex        =   0
      Top             =   1440
      Width           =   975
   End
   Begin VB.Label lbl 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "请入新用户的帐号:"
      ForeColor       =   &H00FFFFFF&
      Height          =   180
      Index           =   4
      Left            =   360
      TabIndex        =   7
      Top             =   240
      Width           =   1620
   End
   Begin VB.Label lbl 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "请入新用户的权限:"
      ForeColor       =   &H00FFFFFF&
      Height          =   180
      Index           =   0
      Left            =   360
      TabIndex        =   6
      Top             =   960
      Width           =   1620
   End
   Begin VB.Label lbl 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "(用户名不能长于12位)"
      ForeColor       =   &H00FFFFFF&
      Height          =   180
      Index           =   1
      Left            =   4680
      TabIndex        =   5
      Top             =   240
      Width           =   1800
   End
   Begin VB.Label lbl 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "(用户权限不能用其它的)"
      ForeColor       =   &H00FFFFFF&
      Height          =   180
      Index           =   3
      Left            =   4680
      TabIndex        =   4
      Top             =   960
      Width           =   1980
   End
End
Attribute VB_Name = "frmNewUser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rst As Recordset
Public password As String

Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdFinally_Click()
    Set rst = New Recordset
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    '判断用户输入的正确性↓
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    If Len(txt.Text) = 0 Then
        MsgBox "新用户名不能为空!"
        Exit Sub
    End If
    If Len(txt.Text) > 12 Then
        MsgBox "用户名不能长于12位!"
        Exit Sub
    End If
    If cmb.Text <> "admin" And cmb.Text <> "user" Then
        MsgBox "用户权限设置错误,不能选择下拉框以外的!"
        Exit Sub
    End If
    '''''''''''''''''''''''''''''用户ID输入的正确性↓
    Call LinkDB(landWay, SName, "weboy", SUName, SUPw)
    con.Open
    Dim getUser As Boolean
    getUser = False
    On Error GoTo errUser
    rst.Open "select name from users", con, adOpenDynamic, adLockOptimistic
    rst.MoveFirst
    getUser = True
errUser:
    If getUser = True Then
        Do While Not rst.EOF
            If rst!name = txt.Text Then
                MsgBox "此用户名已经存在,请换一个!"
                Exit Sub
            End If
            rst.MoveNext
        Loop
    End If
    rst.Close
    con.Close
    frmIBNU.Show
End Sub

Private Sub Form_Load()
    cmb.AddItem ("admin")
    cmb.AddItem ("user")
End Sub

⌨️ 快捷键说明

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