📄 密码修改窗口.frm
字号:
VERSION 5.00
Begin VB.Form Form12
BackColor = &H00808080&
Caption = "密码修改"
ClientHeight = 3075
ClientLeft = 60
ClientTop = 420
ClientWidth = 4305
LinkTopic = "Form12"
ScaleHeight = 3075
ScaleWidth = 4305
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
BackColor = &H00808080&
Caption = "取消"
Height = 255
Left = 3360
Style = 1 'Graphical
TabIndex = 6
Top = 2760
Width = 855
End
Begin VB.CommandButton Command1
BackColor = &H00808080&
Caption = "确定"
Height = 255
Left = 2040
Style = 1 'Graphical
TabIndex = 5
Top = 2760
Width = 855
End
Begin VB.Frame Frame1
BackColor = &H00808080&
Caption = "更改信息"
Height = 2655
Left = 0
TabIndex = 0
Top = 0
Width = 4335
Begin VB.TextBox Text4
Height = 270
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 10
Top = 2040
Width = 2415
End
Begin VB.TextBox Text3
Height = 270
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 9
Top = 1440
Width = 2415
End
Begin VB.TextBox Text2
Height = 270
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 8
Top = 840
Width = 2415
End
Begin VB.TextBox Text1
Height = 270
Left = 1680
TabIndex = 7
Top = 360
Width = 2415
End
Begin VB.Label Label3
BackColor = &H00808080&
Caption = "请确认新密码"
Height = 255
Left = 240
TabIndex = 4
Top = 2040
Width = 1095
End
Begin VB.Label Label1
BackColor = &H00808080&
Caption = "请输入旧密码"
Height = 375
Left = 240
TabIndex = 3
Top = 840
Width = 1215
End
Begin VB.Label Label2
BackColor = &H00808080&
Caption = "请输入新密码"
Height = 375
Left = 240
TabIndex = 2
Top = 1440
Width = 1095
End
Begin VB.Label Label4
BackColor = &H00808080&
Caption = "请输入用户名"
Height = 255
Left = 240
TabIndex = 1
Top = 360
Width = 1095
End
End
End
Attribute VB_Name = "Form12"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim name As String
Dim password As String
Dim rs As ADODB.Recordset
Set conn = New ADODB.Connection
conn.ConnectionString = "Provider=SQLOLEDB.1;password=huangtao;User ID=huangtao;Initial Catalog=canku"
conn.Open
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
name = Trim(Text1.Text)
password = Trim(Text2.Text)
sql = "select * from 用户信息 where 用户名='" & name & "'"
rs.Open sql, conn, 1, 3
If rs.BOF = True And rs.EOF = True Then
MsgBox "该用户不存在!", , "库存管理系统"
Text4.Text = ""
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Else
If password <> rs.Fields(1).Value Then
MsgBox "原密码输入错误!请重新输入!", , "库存管理系统"
Text2.Text = ""
Else
If Text4.Text <> Text3.Text Then
MsgBox "两次输入的新密码不一致!请重新输入", , "库存管理系统"
Text4.Text = ""
Text3.Text = ""
Else
rs.Fields(1).Value = Text3.Text
rs.update
MsgBox "修改密码成功!", , "库存管理系统"
End If
End If
End If
End Sub
Private Sub Command2_Click()
Form12.Hide
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -