📄 form13.frm
字号:
VERSION 5.00
Begin VB.Form Form13
BackColor = &H00FFFFFF&
Caption = "修改密码"
ClientHeight = 5805
ClientLeft = 60
ClientTop = 435
ClientWidth = 7995
BeginProperty Font
Name = "楷体_GB2312"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form13"
Picture = "Form13.frx":0000
ScaleHeight = 5805
ScaleWidth = 7995
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
BackColor = &H00C0E0FF&
Caption = "确定"
Height = 615
Left = 1080
Style = 1 'Graphical
TabIndex = 2
Top = 4680
Width = 2055
End
Begin VB.CommandButton Command2
BackColor = &H00C0E0FF&
Caption = "退出"
Height = 615
Left = 4680
Style = 1 'Graphical
TabIndex = 1
Top = 4680
Width = 2055
End
Begin VB.Frame Frame1
BackColor = &H00FFC0C0&
Caption = "修改密码"
Height = 3735
Left = 600
TabIndex = 0
Top = 360
Width = 6615
Begin VB.TextBox Text4
Height = 495
IMEMode = 3 'DISABLE
Left = 3120
PasswordChar = "*"
TabIndex = 10
Top = 2760
Width = 3375
End
Begin VB.TextBox Text3
Height = 495
IMEMode = 3 'DISABLE
Left = 3120
PasswordChar = "*"
TabIndex = 9
Top = 2040
Width = 3375
End
Begin VB.TextBox Text2
Height = 495
IMEMode = 3 'DISABLE
Left = 3120
PasswordChar = "*"
TabIndex = 8
Top = 1320
Width = 3375
End
Begin VB.TextBox Text1
Height = 495
Left = 3120
TabIndex = 7
Top = 600
Width = 3375
End
Begin VB.Label Label4
Alignment = 2 'Center
BackColor = &H00C0E0FF&
Caption = "请确认新密码"
Height = 495
Left = 360
TabIndex = 6
Top = 2760
Width = 1935
End
Begin VB.Label Label3
Alignment = 2 'Center
BackColor = &H00C0E0FF&
Caption = "请输入新密码"
Height = 495
Left = 360
TabIndex = 5
Top = 2040
Width = 1935
End
Begin VB.Label Label2
Alignment = 2 'Center
BackColor = &H00C0E0FF&
Caption = "请输入旧密码"
Height = 495
Left = 360
TabIndex = 4
Top = 1320
Width = 1935
End
Begin VB.Label Label1
Alignment = 2 'Center
BackColor = &H00C0E0FF&
Caption = "请输入帐号"
Height = 495
Left = 360
TabIndex = 3
Top = 600
Width = 1695
End
End
End
Attribute VB_Name = "Form13"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim rst As New ADODB.Recordset
Dim rstl As New ADODB.Recordset
Private Sub Command1_Click()
Dim hello
con.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=wuhao"
If Text1.Text = "" Then
MsgBox "帐号不能为空!"
Text1.SetFocus
ElseIf Text2.Text = "" Then
MsgBox "密码不能为空!"
Text2.SetFocus
ElseIf Len(Text1.Text) > 20 Then
MsgBox "帐号不得长于20位"
Text1.SetFocus
ElseIf Len(Text2.Text) > 15 Then
MsgBox "密码不得大于15位"
Text2.SetFocus
ElseIf Len(Text3.Text) > 15 Then
MsgBox "密码不得大于15位"
Text3.SetFocus
ElseIf Len(Text4.Text) > 15 Then
MsgBox "密码不得大于15位"
Text4.SetFocus
ElseIf Text3.Text <> Text4.Text Then
MsgBox "两次输入的密码不一致,请重新输入"
Text3.SetFocus
Else
rst.Open "select * from account_xx053_19 where account_id='" & Trim(Text1.Text) & "'and password='" & Trim(Text2.Text) & "'", con, adOpenKeyset, adLockOptimistic
If (rst.EOF) Then
MsgBox "帐号或密码错误,请重新输入", vbExclamation, "信息错误"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
rst.Close
Else
hello = rst.Sort
rst.MoveLast
MsgBox "信息正确", vbExclamation
Text3.SetFocus
'rs.Open "select * from account_xx053_19 where account_id='" & Trim(Text1.Text) & "'and password='" & Trim(Text2.Text) & "'" ', con, adOpenKeyset, adLockOptimistic
Trim (Text3.Text) <> ""
rst.Fields(4) = Trim(Text3.Text)
rst.Update
MsgBox "密码修改成功!"
rst.Close
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text1.SetFocus
Exit Sub
End If
End If
con.Close
End Sub
Private Sub Command2_Click()
Unload Me
Form4.Show
End Sub
Private Sub Form_Load()
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -