📄 frm_mima.frm
字号:
VERSION 5.00
Begin VB.Form Frm_mima
BorderStyle = 1 'Fixed Single
Caption = "修改密码"
ClientHeight = 2715
ClientLeft = 4215
ClientTop = 3330
ClientWidth = 3225
Icon = "Frm_mima.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2715
ScaleWidth = 3225
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "取消"
Height = 315
Left = 1800
TabIndex = 9
Top = 2160
Width = 915
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 315
Left = 420
TabIndex = 8
Top = 2160
Width = 855
End
Begin VB.TextBox Text3
Height = 300
IMEMode = 3 'DISABLE
Left = 1080
PasswordChar = "*"
TabIndex = 7
Top = 1500
Width = 1875
End
Begin VB.TextBox Text2
Height = 300
IMEMode = 3 'DISABLE
Left = 1080
PasswordChar = "*"
TabIndex = 5
Top = 1080
Width = 1875
End
Begin VB.TextBox Text1
Height = 300
IMEMode = 3 'DISABLE
Left = 1080
PasswordChar = "*"
TabIndex = 3
Top = 660
Width = 1875
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1080
Style = 2 'Dropdown List
TabIndex = 1
Top = 240
Width = 1875
End
Begin VB.Label Label4
Caption = "验 证"
Height = 255
Left = 240
TabIndex = 6
Top = 1560
Width = 555
End
Begin VB.Label Label3
Caption = "新密码"
Height = 255
Left = 240
TabIndex = 4
Top = 1140
Width = 555
End
Begin VB.Label Label2
Caption = "旧密码"
Height = 255
Left = 240
TabIndex = 2
Top = 720
Width = 675
End
Begin VB.Label Label1
Caption = "用户名"
Height = 255
Left = 240
TabIndex = 0
Top = 240
Width = 675
End
End
Attribute VB_Name = "Frm_mima"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error GoTo myerr
Dim cn As ADODB.Connection
Dim rst As New ADODB.Recordset
Set cn = GetCn
rst.Open "select mima from yonghu where yh='" & Combo1 & "'", cn, 0, 1
If Text1 <> rst(0) Then
MsgBox "旧密码错误!", vbExclamation, "提示"
Exit Sub
End If
If Text2 <> Text3 Then
MsgBox "新密码两次输入不同!", vbExclamation, "提示"
Exit Sub
End If
rst.Close
cn.Execute "update yonghu set mima='" & Text2 & "' where yh='" & Combo1 & "'"
MsgBox "修改成功!", vbExclamation, "提示"
Unload Me
Exit Sub
myerr:
MsgBox Error, vbExclamation, "提示"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim cn As ADODB.Connection
Dim rst As New ADODB.Recordset
Set cn = GetCn
rst.Open "select yh from yonghu order by 1 ", cn, 0, 1
Do While Not rst.EOF
Combo1.AddItem rst(0)
rst.MoveNext
Loop
Combo1.ListIndex = 0
rst.Close
cn.Close
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -