📄 frmmmxg.frm
字号:
VERSION 5.00
Begin VB.Form FrmMMXG
Caption = "密码修改"
ClientHeight = 3180
ClientLeft = 60
ClientTop = 345
ClientWidth = 4455
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3180
ScaleWidth = 4455
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text4
Height = 315
IMEMode = 3 'DISABLE
Left = 2055
MaxLength = 10
PasswordChar = "*"
TabIndex = 5
Text = "Text4"
Top = 1665
Width = 1380
End
Begin VB.TextBox Text3
Height = 315
IMEMode = 3 'DISABLE
Left = 2055
MaxLength = 10
PasswordChar = "*"
TabIndex = 4
Text = "Text3"
Top = 945
Width = 1380
End
Begin VB.TextBox Text2
Height = 315
IMEMode = 3 'DISABLE
Left = 2055
MaxLength = 10
PasswordChar = "*"
TabIndex = 3
Text = "Text2"
Top = 240
Width = 1380
End
Begin VB.Frame Frame1
Height = 705
Left = 360
TabIndex = 0
Top = 2265
Width = 3405
Begin VB.CommandButton Commclose
BackColor = &H000000FF&
Caption = "关闭(&C)"
Height = 330
Left = 1875
Style = 1 'Graphical
TabIndex = 2
Top = 225
Width = 1215
End
Begin VB.CommandButton Commmend
Caption = "修改(&M)"
Height = 330
Left = 315
Style = 1 'Graphical
TabIndex = 1
Top = 225
Width = 1215
End
End
Begin VB.Label Label4
Caption = "确认新密码:"
Height = 255
Left = 810
TabIndex = 8
Top = 1740
Width = 1260
End
Begin VB.Label Label3
Caption = "新 密 码:"
Height = 255
Left = 810
TabIndex = 7
Top = 1020
Width = 1260
End
Begin VB.Label Label2
Caption = "原 密 码:"
Height = 255
Left = 810
TabIndex = 6
Top = 300
Width = 1260
End
End
Attribute VB_Name = "FrmMMXG"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rst As ADODB.Recordset
Private Sub txt_csy()
On Error Resume Next
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End Sub
Private Sub Commclose_Click()
On Error Resume Next
Unload Me
End Sub
''''用户
'''Global gUserCode As String
'''Global gUserName As String
'''Global gUserpass As String
'''Global gUserQX As Integer
Private Sub Commmend_Click()
On Error Resume Next
If Text4.Text <> Text3.Text Then
MsgBox "口令输入不正确,请重新输入!"
Else
i = 1
While i < Len(Text3.Text) + 1
If Asc(Mid(Text3.Text, i, 1)) < 33 And Asc(Mid(Text3.Text, i, 1)) > 126 Then
MsgBox "密码必须为字母、数字等可识字符,不可为中文!"
End If
i = i + 1
Wend
Set rst = New ADODB.Recordset
rst.Open "select * from userduty where 姓名='" + gUserName + "' and 编号='" + gUserCode + "' and 密码='" + Trim(Text2.Text) + "'", adocnstring, adOpenDynamic, adLockOptimistic, adCmdText
If rst.EOF Then
MsgBox "口令输入不正确,请重新输入!"
Text2.SetFocus
Else
adocn.Execute "update userduty set 密码='" + Trim(Text4.Text) + "' where 姓名='" + gUserName + "' and 编号='" + gUserCode + "' and 密码='" + Trim(Text2.Text) + "'"
rst.Update
MsgBox "口令修改成功!"
gUserpass = Trim(Text4.Text)
Unload Me
End If
rst.Close
Set rst = Nothing
End If
DoEvents
End Sub
Private Sub Form_Load()
On Error Resume Next
' Left = (Screen.Width - Me.Width) / 2
' Top = (Screen.Height - Me.Height) / 2
Call txt_csy
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
On Error Resume Next
If KeyCode = 13 Then
Text3.SetFocus
End If
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
On Error Resume Next
If KeyCode = 13 Then
Text4.SetFocus
End If
End Sub
Private Sub text4_KeyDown(KeyCode As Integer, Shift As Integer)
On Error Resume Next
If KeyCode = 13 Then
Commmend.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -