📄 form_mmxg.frm
字号:
VERSION 5.00
Begin VB.Form Form_mmxg
BorderStyle = 1 'Fixed Single
Caption = "密码修改"
ClientHeight = 2400
ClientLeft = 45
ClientTop = 375
ClientWidth = 6270
Icon = "Form_mmxg.frx":0000
LinkTopic = "Form4"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2400
ScaleWidth = 6270
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
BackColor = &H00C0FFC0&
Height = 2535
Left = 0
TabIndex = 4
Top = -60
Visible = 0 'False
Width = 6315
Begin VB.CommandButton Command4
Caption = "退 出"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 4440
TabIndex = 10
Top = 1680
Width = 1335
End
Begin VB.CommandButton Command3
Caption = "确 定"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 2520
TabIndex = 9
Top = 1680
Width = 1335
End
Begin VB.TextBox Text3
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
IMEMode = 3 'DISABLE
Left = 2520
PasswordChar = "*"
TabIndex = 7
Top = 1080
Width = 2175
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
IMEMode = 3 'DISABLE
Left = 2520
PasswordChar = "*"
TabIndex = 5
Top = 480
Width = 2175
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "请再输入新密码:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 240
Left = 600
TabIndex = 8
Top = 1200
Width = 1920
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "请输入新密码:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 240
Left = 840
TabIndex = 6
Top = 600
Width = 1680
End
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
IMEMode = 3 'DISABLE
Left = 2160
PasswordChar = "*"
TabIndex = 0
Top = 600
Width = 2295
End
Begin VB.CommandButton Command2
Caption = "退 出"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 4320
TabIndex = 2
Top = 1320
Width = 1455
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 = 360
Left = 2160
TabIndex = 1
Top = 1320
Width = 1455
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "请输入密码:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 240
Left = 720
TabIndex = 3
Top = 720
Width = 1440
End
End
Attribute VB_Name = "Form_mmxg"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim lianjie As New Connection
Dim qx As Recordset
Private Sub Command1_Click()
If Trim(Text2) = Trim(mima) Then
Frame1.Visible = True
Text1.SetFocus
Else
MsgBox "密码输入错误,请重新输入!", vbInformation, "提示"
Text2 = ""
Text2.SetFocus
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
If Trim(Text1.Text) <> Trim(Text3.Text) Then
MsgBox "两次输入不一样,请重新输入!", vbInformation, "提示"
Text1.Text = ""
Text3.Text = ""
Text1.SetFocus
Else
'++++++++++++++++++++数据库操作
Set qx = New Recordset
qx.CursorLocation = adUseClient
qx.CursorType = adOpenDynamic
qx.LockType = adLockOptimistic
qx.Open "select * from 权限 where 姓名='" & yonghuming & "'", lianjie
If qx.RecordCount > 0 Then
qx.Fields("密码") = Trim(Text1.Text)
qx.Fields("时间") = Format(Date + Time, "yyyy-mm-dd hh:mm:ss")
qx.Update
mima = Trim(Text1.Text)
MsgBox "密码修改成功!", vbInformation, "提示"
End If
qx.Close
Unload Me
'++++++++++++++++++++数据库操作
End If
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Form_Load()
lianjie.ConnectionString = dblianjie
lianjie.Open
End Sub
Private Sub Form_Unload(Cancel As Integer)
lianjie.Close
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Text1.Text <> "" Then
Text3.SetFocus
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Text2.Text <> "" Then
Command1.SetFocus
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Text3.Text <> "" Then
Command3.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -