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

📄 登录.frm

📁 vb access客房管理系统经典实例添加了模块与access连接
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmLogin 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "登录框"
   ClientHeight    =   8865
   ClientLeft      =   2835
   ClientTop       =   3480
   ClientWidth     =   9825
   Icon            =   "登录.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Picture         =   "登录.frx":0442
   ScaleHeight     =   5237.736
   ScaleMode       =   0  'User
   ScaleWidth      =   9225.143
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.TextBox txtUserName 
      Height          =   345
      Left            =   1800
      TabIndex        =   1
      Top             =   2640
      Width           =   2325
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确定"
      Default         =   -1  'True
      Height          =   390
      Left            =   2520
      TabIndex        =   4
      Top             =   3600
      Width           =   780
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "取消"
      Height          =   390
      Left            =   3360
      TabIndex        =   5
      Top             =   3600
      Width           =   705
   End
   Begin VB.TextBox txtPassword 
      Height          =   345
      IMEMode         =   3  'DISABLE
      Left            =   1800
      PasswordChar    =   "*"
      TabIndex        =   3
      Top             =   3045
      Width           =   2325
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "欢迎登录客房管理系统"
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   26.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   855
      Left            =   240
      TabIndex        =   6
      Top             =   600
      Width           =   5415
   End
   Begin VB.Label lblLabels 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "用户名称(&U):"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   390
      Index           =   0
      Left            =   600
      TabIndex        =   0
      Top             =   2640
      Width           =   1200
   End
   Begin VB.Label lblLabels 
      BackStyle       =   0  'Transparent
      Caption         =   "密码(&P):"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   270
      Index           =   1
      Left            =   720
      TabIndex        =   2
      Top             =   3120
      Width           =   1080
   End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Public LoginSucceeded As Boolean

Private Sub cmdCancel_Click()
    '设置全局变量为 false
    '不提示失败的登录
    LoginSucceeded = False
    Me.Hide
    End
    
End Sub

Private Sub cmdOK_Click()
Static i As Integer
i = i + 1
If i >= 3 Then End

Dim rs3 As ADODB.Recordset
  Set rs3 = New ADODB.Recordset
  Call lj
rs3.Open "select * from 管理人员信息表 where Name='" & txtUserName & "' and Password='" & txtPassword & "'", conn

If txtUserName = "" Or txtPassword = "" Then
MsgBox "请输入用户名或密码完全!", vbCritical, "警告"
txtUserName.SetFocus
Else

If rs3.EOF = True Then
   MsgBox "用户名或密码不正确!", vbCritical, "警告"
   txtUserName = ""
   txtPassword = ""
   txtUserName.SetFocus
  Exit Sub
Else
   MDIForm1.Show
   If rs3(2) = "1" Then
   MDIForm1.mnuuser.Enabled = True
   MDIForm1.mnuguest.Enabled = True
   MDIForm1.mnureport.Enabled = True
   MDIForm1.mnuquit.Enabled = True
   
   End If
   
   
      Unload Me
End If
End If

End Sub

Private Sub Form_Load()
frmLogin.Height = 9240
frmLogin.Width = 9915
MsgBox "为方便老师查看,请用:“用户名:jim”,“密码:123”登陆!"
End Sub

⌨️ 快捷键说明

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