⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 modifypassword.frm

📁 希望给大家看看,能有点启发,是关于一个学生档案管理系统的文档.
💻 FRM
字号:
VERSION 5.00
Begin VB.Form ModifyPassword 
   BackColor       =   &H8000000A&
   Caption         =   "修改密码"
   ClientHeight    =   3885
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3885
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.Frame Frame1 
      BackColor       =   &H8000000A&
      Caption         =   "修改密码"
      Height          =   2775
      Left            =   120
      TabIndex        =   6
      Top             =   240
      Width           =   3975
      Begin VB.Data Data1 
         Caption         =   "Data1"
         Connect         =   "Access"
         DatabaseName    =   "userInformation.mdb"
         DefaultCursorType=   0  '缺省游标
         DefaultType     =   2  '使用 ODBC
         Exclusive       =   0   'False
         Height          =   285
         Left            =   480
         Options         =   0
         ReadOnly        =   0   'False
         RecordsetType   =   1  'Dynaset
         RecordSource    =   "用户信息"
         Top             =   2400
         Visible         =   0   'False
         Width           =   2775
      End
      Begin VB.TextBox Text4 
         Height          =   375
         Left            =   1680
         TabIndex        =   3
         Top             =   1800
         Width           =   1695
      End
      Begin VB.TextBox Text3 
         Height          =   375
         Left            =   1680
         TabIndex        =   2
         Top             =   1320
         Width           =   1695
      End
      Begin VB.TextBox Text2 
         Height          =   375
         Left            =   1680
         TabIndex        =   1
         Top             =   840
         Width           =   1695
      End
      Begin VB.TextBox Text1 
         Height          =   375
         Left            =   1680
         TabIndex        =   0
         Top             =   360
         Width           =   1695
      End
      Begin VB.Label Label5 
         BackStyle       =   0  'Transparent
         Caption         =   "确认新密码"
         Height          =   255
         Left            =   360
         TabIndex        =   10
         Top             =   1920
         Width           =   975
      End
      Begin VB.Label Label4 
         BackStyle       =   0  'Transparent
         Caption         =   "输入新密码"
         Height          =   255
         Left            =   360
         TabIndex        =   9
         Top             =   1440
         Width           =   975
      End
      Begin VB.Label Label2 
         BackStyle       =   0  'Transparent
         Caption         =   "输入旧密码"
         Height          =   225
         Left            =   360
         TabIndex        =   8
         Top             =   960
         Width           =   975
      End
      Begin VB.Label Label1 
         BackStyle       =   0  'Transparent
         Caption         =   "用户名"
         Height          =   255
         Left            =   360
         TabIndex        =   7
         Top             =   480
         Width           =   855
      End
   End
   Begin VB.CommandButton Command2 
      Caption         =   "返回"
      Height          =   495
      Left            =   3600
      TabIndex        =   5
      Top             =   3240
      Width           =   855
   End
   Begin VB.CommandButton Command1 
      Caption         =   "提交"
      Default         =   -1  'True
      Height          =   495
      Left            =   2400
      TabIndex        =   4
      Top             =   3240
      Width           =   855
   End
End
Attribute VB_Name = "ModifyPassword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Text3.Text <> "" And Me.Text4.Text <> "" And Me.Text3.Text <> "" And Me.Text4.Text <> "" Then
    Me.Data1.RecordSource = "用户信息"
    
    Me.Data1.Recordset.Edit
    Me.Data1.Recordset.Fields("输入密码") = Text3.Text
    Me.Data1.Recordset.Fields("确认密码") = Text4.Text
    Me.Data1.Recordset.Update
    Me.Data1.RecordSource = "用户信息"
    Me.Data1.Refresh
    Me.Text1 = "": Me.Text2 = ""
    Me.Text3 = "": Me.Text4 = ""
    Me.Text1.SetFocus
Else
  MsgBox "你的输入无效,请重新再填写!", vbOKOnly + vbExclamation, "提示"
  Me.Text1 = ""
  Me.Text1.SetFocus
End If
Me.Hide
Debarkation.Show
End Sub

Private Sub Command2_Click()
  Me.Hide
 pass.Show
End Sub
Private Sub Text1_LostFocus()
  If Text1.Text <> "" Then
    Me.Data1.RecordSource = "Select * From 用户信息 Where 用户名='" & Text1.Text & " '"
    Me.Data1.Refresh
    If Me.Data1.Recordset.EOF Then
       MsgBox "不存在这个用户,请先登陆!", vbOKOnly + vbExclamation, "错误警告"
       Me.Data1.RecordSource = "用户信息"
       Me.Data1.Refresh
       Text1.Text = ""
       Text1.SetFocus
    Else
       Text2.SetFocus
    End If
   Else
    Text2.Enabled = False: Text3.Enabled = False: Text4.Enabled = False
   End If
End Sub

Private Sub Text2_LostFocus()
 If Text2.Text <> "" Then
   Me.Data1.RecordSource = "Select*From 用户信息 Where 确认密码 ='" & Text2.Text & "'"
   Me.Data1.Refresh
   If Me.Data1.Recordset.EOF Then
      MsgBox "你输入的密码不对,请查询!", vbOKOnly + vbExclamation, "错误提示"
      Me.Data1.RecordSource = "用户信息"
      Me.Data1.Refresh
      Text2.Text = ""
      Text2.SetFocus
   Else
      Me.Text3.SetFocus
   End If

 End If
End Sub

Private Sub Text4_LostFocus()
 If Text4.Text <> "" Then
  If Text4.Text <> Text3.Text Then
     MsgBox "你两次输入的密码不一致,请验证!", vbOKOnly + vbExclamation, "错误提示"
     Text4.Text = ""
     Text4.SetFocus
    
  Else
     Command1.Enabled = True
  End If
 Else
   Command1.Enabled = False
 End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -