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

📄 frmnewuser.frm

📁 软件工程实验报告 银行储蓄管理系统 1.可行性分析 2.总体设计 3.详细设计 4.实验报告模板
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmNewUser 
   BackColor       =   &H00404040&
   BorderStyle     =   1  'Fixed Single
   ClientHeight    =   3090
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   7815
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   3090
   ScaleWidth      =   7815
   Begin VB.CommandButton cmdFinally 
      Caption         =   "完 成"
      Default         =   -1  'True
      Height          =   345
      Left            =   2880
      TabIndex        =   8
      Top             =   2520
      Width           =   975
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "取 消"
      Height          =   345
      Left            =   4200
      TabIndex        =   7
      Top             =   2520
      Width           =   975
   End
   Begin VB.ComboBox cmb 
      Height          =   300
      Left            =   3000
      TabIndex        =   2
      Top             =   1920
      Width           =   2415
   End
   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            =   3000
      TabIndex        =   1
      Top             =   1200
      Width           =   2415
   End
   Begin VB.Label lbl 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "(用户权限不能用其它的)"
      ForeColor       =   &H00FFFFFF&
      Height          =   180
      Index           =   3
      Left            =   5640
      TabIndex        =   6
      Top             =   2040
      Width           =   1980
   End
   Begin VB.Label lbl 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "(用户名不能长于12位)"
      ForeColor       =   &H00FFFFFF&
      Height          =   180
      Index           =   1
      Left            =   5640
      TabIndex        =   5
      Top             =   1320
      Width           =   1800
   End
   Begin VB.Label lbl 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "请入新用户的权限:"
      ForeColor       =   &H00FFFFFF&
      Height          =   180
      Index           =   0
      Left            =   1320
      TabIndex        =   4
      Top             =   2040
      Width           =   1620
   End
   Begin VB.Label lbl 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "请入新用户的帐号:"
      ForeColor       =   &H00FFFFFF&
      Height          =   180
      Index           =   4
      Left            =   1320
      TabIndex        =   3
      Top             =   1320
      Width           =   1620
   End
   Begin VB.Label lbl 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "新建用户"
      BeginProperty Font 
         Name            =   "华文新魏"
         Size            =   15.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   315
      Index           =   2
      Left            =   3120
      TabIndex        =   0
      Top             =   240
      Width           =   1260
   End
   Begin VB.Line line 
      BorderColor     =   &H00FFFFFF&
      BorderWidth     =   2
      X1              =   0
      X2              =   7800
      Y1              =   600
      Y2              =   600
   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 + -