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

📄 frmmodipass.frm

📁 大学数据库原理的课程设计
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmModiPass 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "修改密码"
   ClientHeight    =   2370
   ClientLeft      =   2610
   ClientTop       =   2295
   ClientWidth     =   4365
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2370
   ScaleWidth      =   4365
   Begin VB.CommandButton cmdExit 
      Caption         =   "退出"
      Height          =   312
      Left            =   2205
      TabIndex        =   3
      Top             =   1800
      Width           =   1335
   End
   Begin VB.CommandButton cmdOk 
      Caption         =   "确认"
      Default         =   -1  'True
      Height          =   312
      Left            =   810
      TabIndex        =   2
      Top             =   1800
      Width           =   1335
   End
   Begin VB.Frame Frame1 
      Height          =   1395
      Left            =   240
      TabIndex        =   4
      Top             =   120
      Width           =   3855
      Begin VB.TextBox txtPassword1 
         Height          =   264
         IMEMode         =   3  'DISABLE
         Left            =   1560
         PasswordChar    =   "*"
         TabIndex        =   0
         Top             =   360
         Width           =   1935
      End
      Begin VB.TextBox txtPassword2 
         Height          =   264
         IMEMode         =   3  'DISABLE
         Left            =   1560
         PasswordChar    =   "*"
         TabIndex        =   1
         Top             =   840
         Width           =   1935
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "请输入新密码"
         Height          =   180
         Left            =   360
         TabIndex        =   6
         Top             =   405
         Width           =   1080
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "请确认新密码"
         Height          =   180
         Left            =   360
         TabIndex        =   5
         Top             =   885
         Width           =   1080
      End
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   315
      Left            =   3120
      Top             =   2040
      Visible         =   0   'False
      Width           =   1215
      _ExtentX        =   2143
      _ExtentY        =   556
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Stud97.mdb;Persist Security Info=False"
      OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Stud97.mdb;Persist Security Info=False"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
End
Attribute VB_Name = "frmModiPass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'修改密码窗体frmModiPass
Option Explicit

Private Sub cmdExit_Click()
    Unload Me
End Sub

Private Sub cmdOk_Click() '确认
    '检查各文本框是否为空
    If Trim$(txtPassword1.Text) = "" Then
        MsgBox "请输入新密码!", vbExclamation
        txtPassword1.SetFocus
        Exit Sub
    End If
    If Trim$(txtPassword2.Text) = "" Then
        MsgBox "请确认新密码!", vbExclamation
        txtPassword2.SetFocus
        Exit Sub
    End If
    '检查两次输入密码是否相同
    If Trim$(txtPassword1.Text) <> Trim$(txtPassword2.Text) Then
        MsgBox "确认密码错误,请重新输入!", vbExclamation
        With txtPassword2
            .SetFocus
            .SelStart = 0
            .SelLength = Len(.Text)
        End With
        Exit Sub
    End If
    With Adodc1 '修改密码
        .RecordSource = "SELECT * FROM 用户 WHERE 用户名='" & gstrUser & "'"
        .Refresh
        .Recordset("密码") = txtPassword1.Text
        .Recordset.Update
    End With
    MsgBox "密码修改成功!", vbInformation
End Sub

Private Sub Form_Unload(Cancel As Integer) '窗体卸载时
    frmMain.Show
End Sub

⌨️ 快捷键说明

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