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

📄 frmlogin.frm

📁 简单邮电信息管理
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmLogin 
   BackColor       =   &H80000001&
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "用户登录"
   ClientHeight    =   2265
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4290
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2265
   ScaleWidth      =   4290
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin MSAdodcLib.Adodc AdoLogin 
      Height          =   330
      Left            =   1920
      Top             =   120
      Visible         =   0   'False
      Width           =   1200
      _ExtentX        =   2117
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   1
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=SQLOLEDB.1;Password=624813;Persist Security Info=True;User ID=xt;Data Source=XT"
      OLEDBString     =   "Provider=SQLOLEDB.1;Password=624813;Persist Security Info=True;User ID=xt;Data Source=XT"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select * from User_Info where User_Name='"" & Username & ""'"
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.CommandButton Cmd_Exit 
      Caption         =   "退出"
      Height          =   375
      Left            =   2400
      TabIndex        =   5
      Top             =   1560
      Width           =   975
   End
   Begin VB.CommandButton Cmd_Ok 
      Caption         =   "确定"
      Height          =   375
      Left            =   960
      TabIndex        =   4
      Top             =   1560
      Width           =   975
   End
   Begin VB.TextBox Text2 
      Appearance      =   0  'Flat
      Height          =   270
      IMEMode         =   3  'DISABLE
      Left            =   1680
      PasswordChar    =   "*"
      TabIndex        =   3
      Top             =   1080
      Width           =   1575
   End
   Begin VB.TextBox Text1 
      Appearance      =   0  'Flat
      Height          =   270
      Left            =   1680
      TabIndex        =   1
      Top             =   480
      Width           =   1575
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "密    码:"
      Height          =   255
      Left            =   600
      TabIndex        =   2
      Top             =   1080
      Width           =   975
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "用 户 名:"
      Height          =   255
      Left            =   600
      TabIndex        =   0
      Top             =   480
      Width           =   1095
   End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_Exit_Click()
Unload Me
End
End Sub

Private Sub Cmd_Ok_Click()
Username = Trim(Text1.Text)
Password = Trim(Text2.Text)

If Username = "" Then
    MsgBox "你没有输入用户名", vbOKOnly + vbCritical, "错误"
ElseIf Password = "" Then
    MsgBox "你没有输入密码", vbOKOnly + vbCritical, "错误"
Else
    AdoLogin.RecordSource = "select * from User_Info where User_Name='" & Username & "'"
    AdoLogin.Refresh
    If AdoLogin.Recordset.EOF = True Then
        MsgBox "无此用户", vbOKOnly + vbCritical, "错误"
    ElseIf Password = Trim(AdoLogin.Recordset.Fields("User_Pswd")) Then
        Limit = Trim(AdoLogin.Recordset.Fields("User_Limit"))
        Select Case Limit
        Case "1"
            frmMain.cust = True
            frmMain.order = True
            frmMain.sales = True
            frmMain.stor = True
            frmMain.report = True
            frmMain.letter = True
            frmMain.system = True
            MsgBox "欢迎 " & Username & " 进入本系统,你是 “系统管理员”", vbOKOnly, "^_^  Welcome !"
        Case "2"
            frmMain.cust = True
            frmMain.order = True
            MsgBox "欢迎 " & Username & " 进入本系统,你是 “顾客/订单管理员”", vbOKOnly, "^_^  Welcome !"
        Case "3"
            frmMain.sales = True
            MsgBox "欢迎 " & Username & " 进入本系统,你是 “销售管理员”", vbOKOnly, "^_^  Welcome !"
        Case "4"
            frmMain.stor = True
            MsgBox "欢迎" & Username & " 进入本系统,你是 “仓库管理员”", vbOKOnly, "^_^  Welcome !"
        Case "5"
            frmMain.cust = True
            frmMain.order = True
            frmMain.sales = True
            frmMain.stor = True
            MsgBox "欢迎 " & Username & " 进入本系统,你是“数据查询员”", vbOKOnly, "^_^  Welcome !"
        End Select
        Load frmMain
        frmMain.Show
        Unload Me
        Else
        MsgBox "密码错误", vbOKOnly + vbCritical, "错误"
    End If
End If
End Sub

Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
    Cmd_Ok() = True
End If
End Sub

⌨️ 快捷键说明

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