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

📄 frmadduse.frm

📁 VB下的航空公司信息管理系统.关键词: 航空公司管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmAddUse 
   Caption         =   "添加用户"
   ClientHeight    =   2490
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5520
   Icon            =   "FrmAddUse.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   2490
   ScaleWidth      =   5520
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton CmdExit 
      Caption         =   "退出"
      Height          =   375
      Left            =   4440
      TabIndex        =   7
      Top             =   1920
      Width           =   975
   End
   Begin VB.CommandButton CmdSave 
      Caption         =   "保存"
      Height          =   375
      Left            =   3240
      TabIndex        =   6
      Top             =   1920
      Width           =   975
   End
   Begin VB.TextBox TxtPWDOK 
      Height          =   270
      IMEMode         =   3  'DISABLE
      Left            =   1560
      PasswordChar    =   "*"
      TabIndex        =   5
      Top             =   1320
      Width           =   2415
   End
   Begin VB.TextBox TxtPWD 
      Height          =   270
      IMEMode         =   3  'DISABLE
      Left            =   1560
      PasswordChar    =   "*"
      TabIndex        =   4
      Top             =   840
      Width           =   2415
   End
   Begin VB.TextBox TxtName 
      Height          =   270
      Left            =   1560
      TabIndex        =   3
      Top             =   360
      Width           =   2415
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "确认密码:"
      Height          =   180
      Left            =   480
      TabIndex        =   2
      Top             =   1320
      Width           =   900
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "密码:"
      Height          =   180
      Left            =   480
      TabIndex        =   1
      Top             =   840
      Width           =   540
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "用户名:"
      Height          =   180
      Left            =   480
      TabIndex        =   0
      Top             =   360
      Width           =   720
   End
End
Attribute VB_Name = "FrmAddUse"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim clsm As ClsMain
Private Sub CmdExit_Click()
    Unload Me
End Sub
Private Sub Cmdsave_Click()
    Dim strInsertSQL As String
    Dim strSelectSQL As String
    '判断输入的数据是否完整
    If ((Trim(TxtName.Text) = Empty) Or (Trim(TxtPWD.Text) = Empty) _
        Or (Trim(TxtPWDOK.Text) = Empty)) Then
        MsgBox "请输入所有的数据...", vbInformation + vbOKOnly, "用户资料不完整"
    '判断密码正确性
    ElseIf TxtPWD.Text <> TxtPWDOK.Text Then
        MsgBox "密码与确认密码不符", vbOKOnly, "密码不符"
        TxtPWD.Text = ""
        TxtPWDOK.Text = ""
    ' 弹出消息框,用户确认输入的数据是否准确
    ElseIf MsgBox("用户名称:" & Trim(TxtName.Text) & vbCrLf & _
                      "用户密码:" & Trim(TxtPWD.Text) & vbCrLf _
                      , vbOKCancel, "用户资料确认") = vbOK Then
        strSelectSQL = "select username from uservalidate where username='" & _
                        Trim(TxtName.Text) & "'"
        '判断用户名称是否重复
        If clsm.QueryEmpInfo(strSelectSQL) = True And clsm.g_DBRct.BOF = False And clsm.g_DBRct.EOF = False Then
            MsgBox "已经存在此用户,请重新输入用户名称", vbOKOnly, "用户存在"
            TxtName.Text = ""
            TxtPWD.Text = ""
            TxtPWDOK.Text = ""
        Else
            strInsertSQL = "INSERT INTO UserValidate(UserName,UserPWD)VALUES("
            strInsertSQL = strInsertSQL & "'" & Trim(TxtName.Text) & "'"
            strInsertSQL = strInsertSQL & ",'" & Trim(TxtPWD.Text) & "')"

            If clsm.QueryEmpInfo(strInsertSQL) = True Then
                MsgBox "用户资料已保存...", vbOKOnly, "保存成功"
                TxtName.Text = ""
                TxtPWD.Text = ""
                TxtPWDOK.Text = ""
            End If
        End If
    End If
End Sub

Private Sub Form_Load()
    Set clsm = New ClsMain
    If clsm.ConnectToServer() = False Then Unload Me
End Sub

⌨️ 快捷键说明

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