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

📄 form1.frm

📁 学生信息管理系统可以统计学生的成绩系统需要账户和密码也可以修改密码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form form1 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "登陆"
   ClientHeight    =   6135
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   9150
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Picture         =   "Form1.frx":0000
   ScaleHeight     =   6135
   ScaleWidth      =   9150
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   645
      Left            =   5400
      TabIndex        =   6
      Top             =   4080
      Width           =   1440
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确认"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   645
      Left            =   3600
      TabIndex        =   5
      Top             =   4080
      Width           =   1440
   End
   Begin VB.TextBox txtpassword 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      IMEMode         =   3  'DISABLE
      Left            =   3720
      PasswordChar    =   "*"
      TabIndex        =   4
      Top             =   2880
      Width           =   3105
   End
   Begin VB.TextBox txtusername 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Left            =   3720
      TabIndex        =   2
      Top             =   1800
      Width           =   3105
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "用户密码"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   24
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   525
      Left            =   1320
      TabIndex        =   3
      Top             =   2760
      Width           =   2055
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "用 户 名"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   24
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   525
      Left            =   1320
      TabIndex        =   1
      Top             =   1680
      Width           =   2055
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "学生信息管理系统"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   36
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   855
      Left            =   1320
      TabIndex        =   0
      Top             =   480
      Width           =   6135
   End
End
Attribute VB_Name = "form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim micount As Integer
Dim Conn As New ADODB.Connection
Dim Rs As New ADODB.Recordset
Public Username2 As String
Private Sub Command1_Click()
   Dim Txtsql As String
     Dim Mrc As ADODB.Recordset
     Set Cmd.ActiveConnection = Conn
     If Trim(txtusername.Text = "") Then
           MsgBox "没有这个用户,请重新输入用户名!", , "警告"
           txtusername.Text = ""
           txtusername.SetFocus
        Else
           Txtsql = "select * from 用户表 where 用户名= '" & txtusername.Text & " '"
           Cmd.CommandText = Txtsql
           Cmd.CommandType = adCmdText
           Set Mrc = Cmd.Execute
           If Mrc.EOF = True Then
               MsgBox "没有这个用户,请重新输入用户名!", , "警告"
               txtusername.Text = ""
               txtusername.SetFocus
            Else
               If Trim(Mrc.Fields(1)) = Trim(txtpassword.Text) Then
                      ok = True
                      Mrc.Close
                      Me.Hide
                      Username2 = Trim(txtusername.Text)
                      Unload Me
                      MDIForm1.Show
                      Set Mrc = Nothing
                      Set Conn = Nothing
                  Else
                      MsgBox "输入密码不正确,请重新输入!", , "警告"
                      txtpassword.Text = ""
                      txtpassword.SetFocus
                      micount = micount + 1
                         If micount = 3 Then
                            Me.Hide
                         End If
                  End If
            End If
       End If
        ' Me.Hide
        ' MDIForm1.Visible = True
   Exit Sub
End Sub

Private Sub Command2_Click()
 Set Conn = Nothing
 End
End Sub

Private Sub Form_Load()
connstr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\学生信息管理.mdb"
Conn.Open connstr
End Sub


Private Sub txtpassword_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    Command1.SetFocus
 End If
End Sub

Private Sub txtusername_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    txtpassword.SetFocus
 End If
End Sub

⌨️ 快捷键说明

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