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

📄 frmusermodi.frm

📁 员工信息管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmUserModi 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "修改用户"
   ClientHeight    =   5055
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   7935
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5055
   ScaleWidth      =   7935
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin VB.Frame Frame1 
      Caption         =   "权限设制"
      Height          =   1095
      Left            =   5280
      TabIndex        =   8
      Top             =   240
      Width           =   2295
      Begin VB.OptionButton Option3 
         Caption         =   "读取权限"
         Height          =   180
         Left            =   360
         TabIndex        =   11
         Top             =   720
         Width           =   1095
      End
      Begin VB.OptionButton Option2 
         Caption         =   "修改权限"
         Height          =   180
         Left            =   360
         TabIndex        =   10
         Top             =   480
         Width           =   1215
      End
      Begin VB.OptionButton Option1 
         Caption         =   "无限制"
         Height          =   180
         Left            =   360
         TabIndex        =   9
         Top             =   240
         Width           =   1215
      End
   End
   Begin VB.CommandButton cmdReturn 
      Caption         =   "返 回"
      Height          =   375
      Left            =   6240
      TabIndex        =   7
      Top             =   4200
      Width           =   975
   End
   Begin VB.CommandButton cmdModi 
      Caption         =   "修 改"
      Default         =   -1  'True
      Height          =   375
      Left            =   4200
      TabIndex        =   4
      Top             =   4200
      Width           =   975
   End
   Begin VB.TextBox txtUser_id 
      Height          =   375
      Left            =   1320
      MaxLength       =   8
      TabIndex        =   0
      Top             =   360
      Width           =   3495
   End
   Begin VB.TextBox txtUser_pwd 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   1320
      MaxLength       =   8
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   840
      Width           =   3495
   End
   Begin VB.TextBox txtUser_des 
      Height          =   2175
      Left            =   1320
      MaxLength       =   50
      MultiLine       =   -1  'True
      TabIndex        =   2
      Top             =   1560
      Width           =   6255
   End
   Begin VB.Label lblUser_id 
      Caption         =   "用户名:"
      Height          =   255
      Left            =   480
      TabIndex        =   6
      Top             =   480
      Width           =   855
   End
   Begin VB.Label lblUser_pwd 
      Caption         =   "密 码:"
      Height          =   255
      Left            =   480
      TabIndex        =   5
      Top             =   960
      Width           =   855
   End
   Begin VB.Label lblUser_des 
      Caption         =   "描 述:"
      Height          =   255
      Left            =   480
      TabIndex        =   3
      Top             =   1680
      Width           =   855
   End
End
Attribute VB_Name = "frmUserModi"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim rs As New ADODB.Recordset
Dim strSql As String
Dim strQx As String


Private Sub cmdmodi_Click()
    If Trim(txtUser_pwd.Text) = "" Then
         MsgBox "密码不能为空,请重新输入!", vbOKOnly + vbExclamation, "警告"
         txtUser_pwd.Text = ""
         txtUser_pwd.SetFocus
         Exit Sub
    End If
    If Option1.Value Then
        strQx = "a"
    ElseIf Option2.Value Then
        strQx = "b"
    Else
        strQx = "c"
    End If
    
    strSql = "Update sysuser set user_pwd = '" & txtUser_pwd.Text & "',user_qx='" & strQx & "' ,user_des = '" & Trim(txtUser_des.Text) & " ' Where user_id = '" & tUser_id & "'"
    dbConn.Execute strSql
    
    MsgBox "用户修改成功!", vbOKOnly + vbInformation, "提示"
    cmdReturn.SetFocus
End Sub

Private Sub cmdReturn_Click()
    Unload Me
End Sub

Private Sub Form_Load()
     Me.Icon = LoadPicture(App.Path & "\Graph07.ico")
    txtUser_id.Text = tUser_id
    txtUser_id.Locked = True
    
    strSql = "Select user_pwd,user_qx,user_des from sysuser where user_id = '" & tUser_id & "'"
    rs.Open strSql, dbConn, adOpenForwardOnly, adLockReadOnly
    
    If rs.EOF Then
        MsgBox "没有这个用户,请联系系统管理员!", vbOKOnly + vbExclamation, "警告"
        cmdModi.Enabled = False
    Else
        txtUser_pwd.Text = rs.Fields("user_pwd")
        If Not IsNull(rs.Fields("user_des")) Then
            txtUser_des.Text = rs.Fields("user_des")
        End If
        strQx = rs.Fields("user_qx")
        Select Case strQx
            Case "a"
                Option1.Value = True
            Case "b"
                Option2.Value = True
            Case "c"
                Option3.Value = True
        End Select
    End If
    
    rs.Close
    Set rs = Nothing
End Sub

⌨️ 快捷键说明

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