【VB开源代码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。网学会员整理了VB开源代码-F密码维护.frm的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
VERSION 5.00
Begin VB.Form frmpasswordAdmin
Caption = "密码维护"
ClientHeight = 2745
ClientLeft = 60
ClientTop = 450
ClientWidth = 4065
LinkTopic = "Form1"
ScaleHeight = 2745
ScaleWidth = 4065
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
Caption = "密码维护"
Height = 2655
Left = 0
TabIndex = 0
Top = 0
Width = 3915
Begin VB.TextBox txtCheck
Appearance = 0 'Flat
Height = 345
IMEMode = 3 'DISABLE
Left = 1440
PasswordChar = "*"
TabIndex = 5
Top = 1320
Width = 1845
End
Begin VB.TextBox txtNew
Appearance = 0 'Flat
Height = 345
IMEMode = 3 'DISABLE
Left = 1440
PasswordChar = "*"
TabIndex = 4
Top = 840
Width = 1845
End
Begin VB.TextBox txtOld
Appearance = 0 'Flat
Height = 345
IMEMode = 3 'DISABLE
Left = 1440
PasswordChar = "*"
TabIndex = 3
Top = 360
Width = 1845
End
Begin VB.CommandButton CmdCancel
Caption = "退出"
Height = 375
Left = 2220
TabIndex = 2
Top = 1980
Width = 975
End
Begin
VB.CommandButton CmdOk
Caption = "确定"
Height = 375
Left = 1020
TabIndex = 1
Top = 1920
Width = 855
End
Begin VB.Label Label2
Caption = "确认密码:"
Height = 255
Left = 360
TabIndex = 8
Top = 1440
Width = 975
End
Begin VB.Label Label1
Caption = "新密码(小于10位)"
Height = 435
Left = 360
TabIndex = 7
Top = 840
Width = 1035
End
Begin VB.Label lblLabels
Caption = "旧密码(&P):"
Height = 270
Index = 1
Left = 360
TabIndex = 6
Top = 480
Width = 1080
End
End
End
Attribute VB_Name = "frmpass
wordAdmin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim SQL As String
Dim msg As String
Private Sub CmdOK_Click()
'确定操作
Dim rst As ADODB.Recordset
Dim pOld As String '保存用户的密码
Dim pNew As String '保存用户的新密码
Dim pCheck As String '保存用户的确认密码
'赋值
pOld = Trim(txtOld.Text)
pNew = Trim(txtNew.Text)
pCheck = Trim(txtCheck.Text)
SQL = "select userID,userID,password from 用户信息表 where userID='" & UserID & "'"
SQL = SQL & " and password='" & pOld & "'"
On Error GoTo ErrMsg '出错处理
Set rst = SelectSQL(SQL, msg)
If rst.RecordCount > 0 Then '如果输入密码正确
'检查新密码和确认密码
If (pCheck <> pNew) Then
MsgBox ("两次输入的密码不一致!")
Exit Sub
End If
'接受新的密码
rst.Fields("password") = pNew
rst.Update
MsgBox ("更新成功!")
Else
MsgBox ("用户ID或密码输入错误!")
Exit Sub
End If
Exit Sub
ErrMsg: '出错信息
MsgBox Err.Description, vbExclamation, "出错"
End Sub
Private Sub cmdCancel_Click()
'退出操作
frmBLMS.Enabled = True
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
'退出操作
frmBLMS.Enabled = True
Unload Me
End Sub