📄 form3.frm
字号:
VERSION 5.00
Begin VB.Form Form3
Caption = "修改密码系统"
ClientHeight = 3375
ClientLeft = 60
ClientTop = 450
ClientWidth = 5385
LinkTopic = "Form3"
ScaleHeight = 3375
ScaleWidth = 5385
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 3960
TabIndex = 3
Top = 2760
Width = 735
End
Begin VB.CommandButton Command1
Caption = "确认"
Height = 375
Left = 2760
TabIndex = 2
Top = 2760
Width = 735
End
Begin VB.Frame Frame2
Caption = "修改密码"
Height = 2175
Left = 2520
TabIndex = 1
Top = 240
Width = 2535
Begin VB.TextBox Text2
Height = 375
IMEMode = 3 'DISABLE
Left = 960
PasswordChar = "*"
TabIndex = 5
Top = 1440
Width = 1215
End
Begin VB.TextBox Text1
Height = 375
IMEMode = 3 'DISABLE
Left = 960
PasswordChar = "*"
TabIndex = 4
Top = 600
Width = 1215
End
Begin VB.Label Label2
Caption = "确认密码"
Height = 375
Left = 120
TabIndex = 7
Top = 1440
Width = 735
End
Begin VB.Label Label1
Caption = "新密码"
Height = 375
Left = 120
TabIndex = 6
Top = 720
Width = 615
End
End
Begin VB.Frame Frame1
Caption = "选择用户"
Height = 2175
Left = 360
TabIndex = 0
Top = 240
Width = 1695
Begin VB.ComboBox Combo1
Height = 315
Left = 360
TabIndex = 8
Top = 960
Width = 855
End
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim cnn1 As ADODB.Connection
Dim userpword As ADODB.Recordset
Dim strcnn As String
If Combo1.Text = "" Then
MsgBox "请选择要修改密码的用户", vbOKCancel + vbExclamation, "选择用户"
Combo1.SetFocus
Text1.Text = ""
Text2.Text = ""
Exit Sub
End If
If Text1.Text = "" Then
MsgBox "请输入要修改的密码", vbOKOnly + vbExclamation, "重新输入"
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Exit Sub
End If
If Text2.Text <> Text1.Text Then
MsgBox "请输入确认密码", vbOKOnly + vbExclamation, "输入确认密码"
Text2.Text = ""
Text2.SetFocus
Exit Sub
End If
strcnn = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=db1"
Set cnn1 = New ADODB.Connection
cnn1.Open strcnn
Set userpword = New ADODB.Recordset
userpword.LockType = adLockOptimistic
userpword.Open "select password from use where username='" & Combo1.Text & "'", cnn1, , , adCmdText
userpword.Fields(0).Value = Text1.Text
userpword.Update
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -