📄 main_mmsz.frm
字号:
VERSION 5.00
Begin VB.Form main_mmsz
BackColor = &H00C0C0C0&
Caption = "修改密码"
ClientHeight = 4545
ClientLeft = 60
ClientTop = 345
ClientWidth = 6420
LinkTopic = "Form1"
ScaleHeight = 4545
ScaleWidth = 6420
StartUpPosition = 3 '窗口缺省
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "E:\闰的毕业设计\宾馆客房管理系统\KFGL.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 375
Left = 1800
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "qxsz"
Top = 3960
Visible = 0 'False
Width = 2535
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 3360
TabIndex = 7
Top = 3240
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 495
Left = 840
TabIndex = 6
Top = 3240
Width = 1575
End
Begin VB.TextBox Text3
Height = 495
IMEMode = 3 'DISABLE
Left = 2640
PasswordChar = "*"
TabIndex = 5
Top = 2040
Width = 1815
End
Begin VB.TextBox Text2
Height = 495
IMEMode = 3 'DISABLE
Left = 2640
PasswordChar = "*"
TabIndex = 3
Top = 1320
Width = 1815
End
Begin VB.TextBox Text1
Height = 495
Left = 2640
TabIndex = 1
Top = 600
Width = 1815
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "新密码"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1440
TabIndex = 4
Top = 2160
Width = 1095
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "原密码"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1440
TabIndex = 2
Top = 1440
Width = 1215
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "管理员"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 1440
TabIndex = 0
Top = 720
Width = 1335
End
End
Attribute VB_Name = "main_mmsz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
Data1.DatabaseName = App.Path & "\db.MDB" '自动识别数据库路径
End Sub
Private Sub Form_Activate()
Text1.SetFocus 'text1获得焦点
End Sub
Private Sub Form_Unload(Cancel As Integer)
main.Enabled = True
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text2.SetFocus '回车text2获得焦点
End Sub
Private Sub text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text3.SetFocus '回车text3获得焦点
End Sub
Private Sub Command1_Click() '修改操作员密码
Data1.RecordSource = "select * from qxsz where 操作员='" & Text1.Text & "'"
Data1.Refresh
If Text1.Text <> "" And Text2.Text <> "" And Text2.Text = Data1.Recordset.Fields("密码") Then
If Text3.Text <> "" Then
Data1.Recordset.Edit
Data1.Recordset.Fields("密码") = Text3.Text
MsgBox ("密码修改成功,退出操作员密码修改!")
Data1.Recordset.Update
main.Enabled = True
Unload Me
Else
MsgBox ("请输入新密码!!")
End If
Else
If Text1.Text = "" Then
MsgBox ("请输入操作员!")
Text1.SetFocus
Else
If Text1.Text <> Data1.Recordset.Fields("操作员") Then
Text1.SetFocus
Text1.Text = ""
MsgBox ("无此操作员,请重新输入!")
End If
End If
If Text2.Text = "" Then
MsgBox ("请输入操作员原密码!")
Text2.SetFocus
Else
If Text2.Text <> ma.Text Then
MsgBox ("原密码错误,请重新输入原密码!")
Text2.SetFocus
End If
End If
End If
End Sub
Private Sub Command2_Click()
main.Enabled = True
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -