📄 frmsystemusermodify.frm
字号:
VERSION 5.00
Begin VB.Form frmSystemUserModify
BorderStyle = 3 'Fixed Dialog
Caption = "密码修改"
ClientHeight = 2955
ClientLeft = 45
ClientTop = 330
ClientWidth = 5205
Icon = "frmSystemUserModify.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2955
ScaleWidth = 5205
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.Frame Frame1
Height = 2325
Left = 330
TabIndex = 3
Top = 240
Width = 3225
Begin VB.TextBox txtOldPwd
Height = 330
IMEMode = 3 'DISABLE
Left = 1410
PasswordChar = "*"
TabIndex = 6
Top = 915
Width = 1605
End
Begin VB.TextBox txtNewPwd
Height = 330
IMEMode = 3 'DISABLE
Left = 1410
PasswordChar = "*"
TabIndex = 5
Top = 1470
Width = 1605
End
Begin VB.ComboBox cboUser
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 360
IMEMode = 2 'OFF
Left = 1410
TabIndex = 4
Top = 360
Width = 1605
End
Begin VB.Label Label1
Caption = "用 户:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 375
Left = 210
TabIndex = 9
Top = 360
Width = 1125
End
Begin VB.Label Label2
Caption = "旧密码:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 375
Left = 210
TabIndex = 8
Top = 930
Width = 1125
End
Begin VB.Label Label3
Caption = "新密码:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 375
Left = 210
TabIndex = 7
Top = 1530
Width = 1125
End
End
Begin VB.CommandButton Command1
Caption = "删除用户"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 345
Left = 3840
TabIndex = 2
Top = 1710
Width = 1215
End
Begin VB.CommandButton cmdExit
Caption = "取消"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 345
Left = 3840
TabIndex = 1
Top = 1140
Width = 1215
End
Begin VB.CommandButton cmdDenJ
BackColor = &H00C0C0C0&
Caption = "确定"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 345
Left = 3840
MaskColor = &H00FFFFFF&
Style = 1 'Graphical
TabIndex = 0
Top = 570
UseMaskColor = -1 'True
Width = 1215
End
End
Attribute VB_Name = "frmSystemUserModify"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Recuser As Recordset
Private Sub cmdDenJ_Click()
'用户名未填写
If Len(cboUser) = 0 Then
MsgBox "请填写用户名!", vbExclamation + vbOKOnly, "信息"
Exit Sub
End If
'旧密码不正确
Recuser.FindFirst "user='" + Trim(cboUser) + "' and pwd='" + Trim(txtOldPwd) + "'"
If Recuser.NoMatch Then
MsgBox "旧密码不正确!", vbExclamation + vbOKOnly, "信息"
txtOldPwd = ""
txtOldPwd.SetFocus
Else
If Len(txtNewPwd) = 0 Then
MsgBox "密码不能为空!", vbExclamation + vbOKOnly, "信息"
txtNewPwd.SetFocus
Else
Recuser.Edit
Recuser.Fields("pwd") = Trim(txtNewPwd)
Recuser.Update
MsgBox "祝贺您,修改成功!", vbExclamation + vbOKOnly, "信息"
cboUser = ""
txtOldPwd = ""
txtNewPwd = ""
Unload Me
End If
End If
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub Command1_Click()
Recuser.FindFirst "user='" + Trim(cboUser) + "'"
Recuser.Delete
cboUser.Clear
Recuser.MoveLast
Recuser.MoveFirst
While Not Recuser.EOF
cboUser.AddItem Recuser.Fields("user")
Recuser.MoveNext
Wend
cboUser.SetFocus
End Sub
Private Sub Form_Load()
Set Recuser = dbEstate.OpenRecordset("select * from user", dbOpenDynaset)
Recuser.MoveLast
Recuser.MoveFirst
While Not Recuser.EOF
cboUser.AddItem Recuser.Fields("user")
Recuser.MoveNext
Wend
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -