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

📄 frmlogin.frm

📁 用VB实现的一个学生管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{D27CDB6B-AE6D-11CF-96B8-444553540000}#1.0#0"; "flash8b.ocx"
Begin VB.Form frmLogin 
   BackColor       =   &H00FFFFFF&
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "系统登录"
   ClientHeight    =   3225
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4545
   ControlBox      =   0   'False
   Icon            =   "frmLogin.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3225
   ScaleWidth      =   4545
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消"
      Height          =   375
      Left            =   2880
      TabIndex        =   5
      Top             =   2400
      Width           =   975
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确认"
      Default         =   -1  'True
      Height          =   375
      Left            =   720
      TabIndex        =   4
      Top             =   2400
      Width           =   975
   End
   Begin VB.TextBox txtPassword 
      DataField       =   "Password"
      DataSource      =   "Adodc1"
      Height          =   270
      IMEMode         =   3  'DISABLE
      Left            =   1800
      PasswordChar    =   "*"
      TabIndex        =   3
      Text            =   "txtPassword"
      Top             =   2040
      Width           =   2055
   End
   Begin VB.TextBox txtName 
      DataField       =   "Name"
      DataSource      =   "Adodc1"
      Height          =   270
      Left            =   1800
      TabIndex        =   2
      Text            =   "txtName"
      Top             =   1680
      Width           =   2055
   End
   Begin ShockwaveFlashObjectsCtl.ShockwaveFlash ShockwaveFlash1 
      Height          =   1935
      Left            =   -240
      TabIndex        =   7
      Top             =   -253
      Width           =   4815
      _cx             =   8493
      _cy             =   3413
      FlashVars       =   ""
      Movie           =   ""
      Src             =   ""
      WMode           =   "Window"
      Play            =   -1  'True
      Loop            =   -1  'True
      Quality         =   "High"
      SAlign          =   ""
      Menu            =   -1  'True
      Base            =   ""
      AllowScriptAccess=   ""
      Scale           =   "ShowAll"
      DeviceFont      =   0   'False
      EmbedMovie      =   0   'False
      BGColor         =   ""
      SWRemote        =   ""
      MovieData       =   ""
      SeamlessTabbing =   -1  'True
      Profile         =   0   'False
      ProfileAddress  =   ""
      ProfilePort     =   0
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackColor       =   &H00FFFFFF&
      Caption         =   "用户名:"
      Height          =   180
      Left            =   840
      TabIndex        =   0
      Top             =   1680
      Width           =   720
   End
   Begin VB.Label Label4 
      BackColor       =   &H00FFFFFF&
      Caption         =   "作者:郑智鹏"
      Height          =   255
      Left            =   3240
      TabIndex        =   6
      Top             =   2880
      Width           =   1215
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackColor       =   &H00FFFFFF&
      Caption         =   "密码:"
      Height          =   180
      Left            =   840
      TabIndex        =   1
      Top             =   2040
      Width           =   540
   End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
  Private Declare Sub InitCommonControls Lib "comctl32.dll" ()

    Private Sub Form_Initialize()
ShockwaveFlash1.Movie = App.Path & "\flash\top.swf"
InitCommonControls

    End Sub
Private Sub cmdCancel_Click()
If MsgBox("您真的要退出本系统的使用吗?", vbYesNo + vbQuestion, "退出询问") = vbYes Then
   Set adoRS = Nothing
   adoCon.Close
   Set adoCon = Nothing
   Unload Me
End If
End Sub

Private Sub CmdOK_Click()
On Error GoTo errMsg
Dim sql As String
sql = ""
sql = "Select Count(*) From Login Where Name='" & Trim(txtname.Text) & "'"
sql = sql & " And Password='" & Trim(txtPassword.Text) & "'"
Set adoRS = adoCon.Execute(sql)
If adoRS(0) = 0 Then
  MsgBox "您输入的用户名或密码有误!", vbOKOnly + vbExclamation, "系统提示"
 txtname.SetFocus
Exit Sub
End If
sql = "Select * From Login Where Name='" & Trim(txtname.Text) & "'"
sql = sql & " And Password='" & Trim(txtPassword.Text) & "'"
Set adoRS = adoCon.Execute(sql)

userqx = Trim(adoRS("身份"))
frmmain.Show
Unload Me
errMsg:
  If Err.Number <> 0 Then
     MsgBox CStr(Err.Number) + Err.Description, vbOKOnly + vbCritical, "错误提示"
     Exit Sub
  End If

End Sub


Private Sub Form_Load()
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 - 800

On Error GoTo errMsg

txtname.Text = ""
txtPassword.Text = ""

Call ConnectDB

errMsg:
  If Err.Number <> 0 Then
    MsgBox Err.Number & Err.Description, vbOKOnly + vbCritical, "出错提示"
    Exit Sub
  End If
End Sub

⌨️ 快捷键说明

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