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

📄 frmcheck.frm

📁 是关于图书的管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmcheck 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "登陆"
   ClientHeight    =   2730
   ClientLeft      =   6150
   ClientTop       =   3165
   ClientWidth     =   4770
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Picture         =   "frmcheck.frx":0000
   ScaleHeight     =   2730
   ScaleWidth      =   4770
   ShowInTaskbar   =   0   'False
   Begin VB.TextBox Text2 
      BackColor       =   &H00FFC0C0&
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   840
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   1080
      Width           =   2295
   End
   Begin VB.TextBox Text3 
      BackColor       =   &H00FFC0C0&
      Height          =   375
      Left            =   840
      TabIndex        =   2
      Top             =   1560
      Width           =   2295
   End
   Begin VB.TextBox Text1 
      BackColor       =   &H00FFC0C0&
      Height          =   375
      Left            =   840
      TabIndex        =   0
      Top             =   600
      Width           =   2295
   End
   Begin VB.CommandButton Command2 
      Caption         =   "关闭"
      Height          =   375
      Left            =   3480
      Picture         =   "frmcheck.frx":2B3F2
      Style           =   1  'Graphical
      TabIndex        =   4
      Top             =   2160
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      Caption         =   "登陆"
      Height          =   375
      Left            =   2160
      Picture         =   "frmcheck.frx":2D6DD
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   2160
      Width           =   975
   End
   Begin VB.Label Label7 
      BackStyle       =   0  'Transparent
      Caption         =   "(密码6位)"
      Height          =   255
      Left            =   3360
      TabIndex        =   11
      Top             =   1200
      Width           =   1215
   End
   Begin VB.Label Label6 
      BackStyle       =   0  'Transparent
      Caption         =   "(权限请输入: 管理员或读者)"
      Height          =   375
      Left            =   3240
      TabIndex        =   10
      Top             =   1560
      Width           =   1335
   End
   Begin VB.Label Label5 
      BackStyle       =   0  'Transparent
      Caption         =   "(用户名6位)"
      Height          =   255
      Left            =   3360
      TabIndex        =   9
      Top             =   720
      Width           =   1215
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Caption         =   "  权限:"
      Height          =   375
      Left            =   120
      TabIndex        =   8
      Top             =   1680
      Width           =   855
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "  密码:"
      Height          =   375
      Left            =   120
      TabIndex        =   7
      Top             =   1200
      Width           =   855
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "用户名:"
      Height          =   375
      Left            =   120
      TabIndex        =   6
      Top             =   720
      Width           =   855
   End
   Begin VB.Label Label3 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "图书馆图书管理系统"
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   21.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00400040&
      Height          =   495
      Left            =   120
      TabIndex        =   5
      Top             =   0
      Width           =   4215
   End
End
Attribute VB_Name = "frmcheck"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
    
    Static i
    If Text3 = "管理员" Then
    sql = "select * from manager"
  myrs.Open sql, myconn, adOpenDynamic, adLockOptimistic
  
  myrs.MoveFirst
  
  Do While myrs.EOF = False
     If Trim(Text1.Text) = Trim(myrs.Fields(0).Value) Then
        If Trim(Text2.Text) = Trim(myrs.Fields(1).Value) Then
           MDIForm1.Show
           Unload Me
           Exit Sub
        Else
           MsgBox "密码错误!", 1, "请输入密码"
           Text2.SetFocus
           Text2.Text = ""
           Exit Sub
                End If
            End If
     myrs.MoveNext
  Loop
  
  Else
  If Text3 = "读者" Then
   sql = "select * from readerInfo"
  myrs.Open sql, myconn, adOpenDynamic, adLockOptimistic
  
  myrs.MoveFirst
  
  Do While myrs.EOF = False
     If Trim(Text1.Text) = Trim(myrs.Fields(0).Value) Then
        If Trim(Text2.Text) = Trim(myrs.Fields(1).Value) Then
           MDIForm1.Show
           Unload Me
           Exit Sub
        Else
           MsgBox "密码错误!", 1, "请输入密码"
           Text2.SetFocus
           Text2.Text = ""
           Exit Sub
                End If
            End If
     myrs.MoveNext
  Loop
     
  MsgBox "该用户不存在", 1, "请重新输入"
  Text1.SetFocus
  Text1.Text = ""
  End If
  End If
ErrorHandler:
  i = i + 1  '累加次数,达到3次不能够访问本系统
  If i <= 2 Then
   MsgBox "连接失败,请重新输入用户名或口令", , "注意"
    Text1.SetFocus
 Else
   MsgBox "连接失败,您不能使用本系统", , "注意"
   End
End If

  
End Sub

Private Sub Command2_Click()
    Unload Me
End Sub

Private Sub Form_Load()
  myconn.ConnectionString = "Driver={SQL SERVER};Server=w10-080;Database=图书馆管理系统"
  myconn.CursorLocation = adUseClient
  myconn.Open
End Sub

⌨️ 快捷键说明

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