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

📄 editpassword.frm

📁 一个学生信息管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Editpassword 
   Caption         =   "修改密码"
   ClientHeight    =   3495
   ClientLeft      =   5565
   ClientTop       =   3765
   ClientWidth     =   4905
   LinkTopic       =   "Form1"
   ScaleHeight     =   3495
   ScaleWidth      =   4905
   Begin VB.CheckBox Check1 
      Caption         =   "修改用户名"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   240
      TabIndex        =   7
      Top             =   360
      Width           =   1575
   End
   Begin VB.CommandButton Command2 
      Caption         =   "退出"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3120
      TabIndex        =   6
      Top             =   2640
      Width           =   855
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确认"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1320
      TabIndex        =   5
      Top             =   2640
      Width           =   855
   End
   Begin VB.TextBox Text3 
      Height          =   375
      Left            =   1920
      TabIndex        =   4
      Top             =   1800
      Width           =   1695
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Left            =   1920
      TabIndex        =   3
      Top             =   1080
      Width           =   1695
   End
   Begin VB.TextBox Text1 
      Enabled         =   0   'False
      Height          =   375
      Left            =   1920
      TabIndex        =   2
      Top             =   360
      Width           =   1695
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "确认密码"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   720
      TabIndex        =   1
      Top             =   1920
      Width           =   975
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "修改密码"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   720
      TabIndex        =   0
      Top             =   1200
      Width           =   975
   End
End
Attribute VB_Name = "Editpassword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Check1_Click()
    If Check1.Value = 1 Then
       Text1.Enabled = True
    Else
       Text1.Enabled = False
    End If
End Sub
Private Sub Command1_Click()
    Dim txtSQL As String
    Dim mrc As ADODB.Recordset
    Dim MsgText As String
    If Trim(Text1.Text) = "" Then
        MsgBox "请输入用户名称!", vbOKOnly + vbExclamation, "警告"
        Exit Sub
        Text1.SetFocus
    End If
    
    '判断是否有重复用户
    txtSQL = "select * from mima where username= " & "'" & Trim(Text1.Text) & "'" & ""
    Set mrc = ExecuteSQL(txtSQL, MsgText)
    If mrc.EOF = False And Check1.Value = 1 Then
        MsgBox "用户姓名重复,请重新输入", vbOKOnly + vbExclamation, "警告!"
        mrc.Close
        Text1.SetFocus
        Exit Sub
    Else
       If Check1.Value = 0 Then
         mrc.Delete
       Else
         mrc.Close
       End If
    End If
    
    If Trim(Text2.Text) <> Trim(Text3.Text) Then
        MsgBox "两次输入密码不一样,请确认!", vbOKOnly + vbExclamation, "警告"
        Text2.SetFocus
        Text2.Text = ""
        Text3.Text = ""
        Exit Sub
        
    Else
        If Text2.Text = "" Then
            MsgBox "密码不能为空!", vbOKOnly + vbExclamation, "警告"
            Text2.SetFocus
            Text2.Text = ""
            Text3.Text = ""
        Else
            '判断完成,开始操作
            txtSQL = "select * from mima"
            '动态绑定数据库
            Set mrc = ExecuteSQL(txtSQL, MsgText)
            mrc.AddNew
            mrc.Fields(0) = Trim(Text1.Text)
            mrc.Fields(1) = Trim(Text2.Text)
            mrc.Update
            mrc.Close
            Me.Hide
            MsgBox "修改成功!", vbOKOnly + vbExclamation, "修改密码"
        End If
    End If
End Sub


Private Sub Command2_Click()
    Unload Me
End Sub

⌨️ 快捷键说明

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