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

📄 mmshzh.frm

📁 本系统以记录学生信息
💻 FRM
字号:
VERSION 5.00
Object = "{00028C01-0000-0000-0000-000000000046}#1.0#0"; "DBGRID32.OCX"
Begin VB.Form mmshzh 
   BackColor       =   &H00800000&
   Caption         =   "密码设置"
   ClientHeight    =   5490
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4200
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   5490
   ScaleWidth      =   4200
   StartUpPosition =   2  '屏幕中心
   Begin VB.Data Data1 
      Caption         =   "Data1"
      Connect         =   "Access"
      DatabaseName    =   "D:\vb\学生档案管理系统.mdb"
      DefaultCursorType=   0  '缺省游标
      DefaultType     =   2  '使用 ODBC
      Exclusive       =   0   'False
      Height          =   345
      Left            =   -480
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   "密码表"
      Top             =   0
      Visible         =   0   'False
      Width           =   1065
   End
   Begin VB.TextBox Text1 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   1560
      PasswordChar    =   "*"
      TabIndex        =   6
      Top             =   720
      Width           =   2175
   End
   Begin VB.CommandButton OKCommand 
      BackColor       =   &H00C0C0FF&
      Caption         =   "确  认"
      Height          =   375
      Left            =   600
      Style           =   1  'Graphical
      TabIndex        =   5
      Top             =   4920
      Visible         =   0   'False
      Width           =   975
   End
   Begin VB.CommandButton CancelCommand 
      BackColor       =   &H00C0C0FF&
      Caption         =   "放  弃"
      Height          =   375
      Left            =   1680
      Style           =   1  'Graphical
      TabIndex        =   4
      Top             =   4920
      Visible         =   0   'False
      Width           =   975
   End
   Begin VB.TextBox Text2 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   1560
      PasswordChar    =   "*"
      TabIndex        =   3
      Top             =   1320
      Visible         =   0   'False
      Width           =   2175
   End
   Begin VB.CommandButton ExitCommand 
      BackColor       =   &H00FFFFC0&
      Caption         =   "返 回"
      Height          =   375
      Left            =   2760
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   4440
      Visible         =   0   'False
      Width           =   975
   End
   Begin VB.CommandButton DeleteCommand 
      BackColor       =   &H00FFFFC0&
      Caption         =   "删除一人"
      Height          =   375
      Left            =   1680
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   4440
      Visible         =   0   'False
      Width           =   975
   End
   Begin VB.CommandButton AddCommand 
      BackColor       =   &H00FFFFC0&
      Caption         =   "增加一人"
      Height          =   375
      Left            =   600
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   4440
      Visible         =   0   'False
      Width           =   975
   End
   Begin MSDBGrid.DBGrid DBGrid1 
      Bindings        =   "mmshzh.frx":0000
      Height          =   2175
      Left            =   120
      OleObjectBlob   =   "mmshzh.frx":0014
      TabIndex        =   7
      Top             =   2040
      Visible         =   0   'False
      Width           =   3975
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      BackColor       =   &H00800000&
      Caption         =   "设置用户"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FFFF&
      Height          =   285
      Left            =   1440
      TabIndex        =   11
      Top             =   240
      Visible         =   0   'False
      Width           =   1140
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      BackColor       =   &H00800000&
      Caption         =   "修改密码"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FFFF&
      Height          =   285
      Left            =   1440
      TabIndex        =   10
      Top             =   240
      Visible         =   0   'False
      Width           =   1140
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "您的密码:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   240
      Left            =   420
      TabIndex        =   9
      Top             =   780
      Width           =   1200
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "新密码:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   240
      Left            =   420
      TabIndex        =   8
      Top             =   1440
      Visible         =   0   'False
      Width           =   960
   End
End
Attribute VB_Name = "mmshzh"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub AddCommand_Click()
     With Data1.Recordset
          .AddNew
          .Fields("权限") = "操作"
          .Update
     End With
End Sub

Private Sub CancelCommand_Click()
    Unload Me
End Sub

Private Sub DeleteCommand_Click()
     With Data1.Recordset
     If Not .EOF And .AbsolutePosition > 0 Then
           .Delete
           .MovePrevious
     End If
     End With
End Sub

Private Sub ExitCommand_Click()
   Unload Me
End Sub

Private Sub Form_Activate()
    With Data1.Recordset
    If .RecordCount = 0 Then
       .AddNew
       .Fields("权限").Value = "管理"
       .Fields("口令").Value = "123"    '最初的管理员口令为:123
       .Update
    End If
    End With
End Sub

Private Sub OKCommand_Click()
   With Data1.Recordset
       .Edit
        If Not Text2.Text = "" Then .Fields("口令").Value = Text2.Text
       .Update
   End With
   Unload Me
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
  If KeyAscii = vbKeyReturn Then
    Data1.Recordset.FindFirst "口令='" & Text1.Text & "'"
    If Data1.Recordset.NoMatch Then
        Unload Me
    Else
        If Data1.Recordset.Fields("权限").Value = "管理" Then
            Label4.Visible = True
            Label1.Visible = False
            Text1.Visible = False
            DBGrid1.Visible = True
            exitcommand.Visible = True
            DeleteCommand.Visible = True
            addcommand.Visible = True
        Else
            Label3.Visible = True
            Label2.Visible = True
            Text2.Visible = True
            OKCommand.Visible = True
            cancelCommand.Visible = True
        End If
    End If
End If
End Sub

⌨️ 快捷键说明

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