login.frm

来自「本软件为咨询公司开发的合同管理软件,运用MDB数据库.」· FRM 代码 · 共 153 行

FRM
153
字号
VERSION 5.00
Begin VB.Form frmLogin 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "登录"
   ClientHeight    =   1740
   ClientLeft      =   2835
   ClientTop       =   3480
   ClientWidth     =   4905
   Icon            =   "Login.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1028.049
   ScaleMode       =   0  'User
   ScaleWidth      =   4605.529
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000000&
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   495
      Left            =   360
      Picture         =   "Login.frx":08CA
      ScaleHeight     =   495
      ScaleWidth      =   735
      TabIndex        =   6
      Top             =   840
      Width           =   735
   End
   Begin VB.TextBox txtUserName 
      Height          =   345
      Left            =   2280
      TabIndex        =   1
      Top             =   255
      Width           =   2325
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确定"
      Default         =   -1  'True
      Height          =   390
      Left            =   1455
      TabIndex        =   4
      Top             =   1140
      Width           =   1140
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "取消"
      Height          =   390
      Left            =   3060
      TabIndex        =   5
      Top             =   1140
      Width           =   1140
   End
   Begin VB.TextBox txtPassword 
      Height          =   345
      IMEMode         =   3  'DISABLE
      Left            =   2280
      PasswordChar    =   "*"
      TabIndex        =   3
      Top             =   645
      Width           =   2325
   End
   Begin VB.Label lblLabels 
      Caption         =   "用户名称(&U):"
      Height          =   270
      Index           =   0
      Left            =   1065
      TabIndex        =   0
      Top             =   270
      Width           =   1080
   End
   Begin VB.Label lblLabels 
      Caption         =   "密码(&P):"
      Height          =   270
      Index           =   1
      Left            =   1065
      TabIndex        =   2
      Top             =   660
      Width           =   1080
   End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

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

Private Sub cmdOK_Click()
    '检查正确的密码
   Set mmdb = OpenDatabase(App.Path & "\data\htxxk.mdb")
  
   Set mmr = mmdb.OpenRecordset("select * from mxx where 使用人 = '" & Trim(txtUserName.Text) & "' AND 密码 = '" & Trim(txtPassword.Text) & "'")
    
   If mmr.RecordCount <> 0 Then
        '将代码放在这里传递
        '成功到 calling 函数
        '设置全局变量时最容易的
         
        LoginSucceeded = True
        Me.Hide
    
    'Set rsjl = mmdb.OpenRecordset("ykjl")
    'ykjls = mmr.RecordCount

    
    
    If FileExists(czk) = False Then
       xx = MsgBox("网络数据库文件没有找到,现在操作的是本地数据库文件!!", 48)
    
    
       czk = App.Path & "\data\htxxk.mdb"
     
       dblj = czk
       
      frmMAIN.Show
 
    
     Else

       dblj = czk
      
      frmMAIN.Show

    End If

    
    
    
    Else
        MsgBox "无效的密码,请重试!", , "登录"
        txtPassword.SetFocus
        SendKeys "{Home}+{End}"
    End If






End Sub

⌨️ 快捷键说明

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