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

📄 frmlogin.frm

📁 考勤机管理软件,用于统计某段时间某个部门或者某个员工在某段内迟到与早退次数.
💻 FRM
字号:
VERSION 5.00
Object = "{CEF42A98-96F2-4C8E-B783-B04E815A05D0}#1.0#0"; "sClientDog.ocx"
Object = "{AE2D0CA9-589B-4154-98AB-A4E03BC0ED7F}#1.0#0"; "sServerDog.ocx"
Begin VB.Form FrmLogin 
   Caption         =   "登陆窗口"
   ClientHeight    =   2625
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4755
   Icon            =   "frmLogin.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   2625
   ScaleWidth      =   4755
   StartUpPosition =   2  'CenterScreen
   Begin VB.ComboBox cboName 
      Height          =   315
      Left            =   1740
      TabIndex        =   5
      Text            =   "Combo1"
      Top             =   630
      Width           =   1875
   End
   Begin VB.TextBox txtPWD 
      Height          =   285
      IMEMode         =   3  'DISABLE
      Left            =   1740
      PasswordChar    =   "*"
      TabIndex        =   4
      Text            =   "Text3"
      Top             =   1110
      Width           =   1875
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "退出"
      Height          =   375
      Left            =   2520
      TabIndex        =   3
      Top             =   1695
      Width           =   1335
   End
   Begin VB.CommandButton cmdLogin 
      Caption         =   "登陆"
      Height          =   375
      Left            =   675
      TabIndex        =   2
      Top             =   1710
      Width           =   1335
   End
   Begin SCLIENTDOGLib.SClientDog SClientDog1 
      Left            =   900
      Top             =   135
      _Version        =   65536
      _ExtentX        =   960
      _ExtentY        =   960
      _StockProps     =   0
   End
   Begin SSERVERDOGLib.SServerDog SServerDog1 
      Left            =   135
      Top             =   60
      _Version        =   65536
      _ExtentX        =   960
      _ExtentY        =   960
      _StockProps     =   0
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "密  码:"
      Height          =   180
      Left            =   1035
      TabIndex        =   1
      Top             =   1170
      Width           =   630
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "用户名:"
      Height          =   180
      Left            =   1005
      TabIndex        =   0
      Top             =   675
      Width           =   630
   End
End
Attribute VB_Name = "FrmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rec As New ADODB.Recordset '主记录集

Dim tmpRst As New ADODB.Recordset
Public Lrst As New ADODB.Recordset '----- 2005-10-5(多帐套添加)
Dim Lcn As New Connection '---- 2005-10-5( 多帐套添加)
Dim strLcn As String  '---- 2005-10-5(多帐套添加)
Dim strCN As String '---- 2005-10-5 (多帐套添加)



Private Sub Form_Load()
        
    cboName.Clear
    txtPWD.Text = ""
    
    SServerDog1.LocalPort = 5111
    SServerDog1.DogSn = "000074"
    SServerDog1.Listen
    
    SClientDog1.RemoteHost = "127.0.0.1"
    SClientDog1.RemotePort = 5111
    SClientDog1.DogSn = "000074"
    SClientDog1.Run
    
    
    Dim strSQL As String
    strSQL = "Driver={SQL Server};Server=127.0.0.1;Uid=sa;Pwd=;Database=KQJ"
    con.Open strSQL
    
    rec.CursorLocation = adUseClient
    rec.Open "SELECT * FROM LOGIN", con, adOpenStatic, adLockBatchOptimistic
    
    cboName.Clear
    If rec.RecordCount > 0 Then
        rec.MoveFirst
        Do While Not rec.EOF
            cboName.AddItem rec.Fields("Name")
            rec.MoveNext
        Loop
    End If
    If cboName.ListCount > 0 Then cboName.ListIndex = 0
    
    
End Sub

Private Sub cmdCANCEL_Click()
    Unload Me
End Sub

Private Sub cmdLogin_Click()
    If Len(cboName.Text) = 0 Then
        Message "请选择用户名!"
        Exit Sub
    End If

    rec.MoveFirst
    rec.Find "Name='" & cboName.Text & "'"
     
    If Trim(txtPWD.Text) = Trim(rec.Fields("Password")) & vbNullString Then
    
            UserName = rec.Fields("Name")
            UserID = rec.Fields("LoginID")
            
            MDI.Show
            FristMain
            Me.Hide
    Else
        Message "密码不正确!"
    End If
    
End Sub

Private Sub Form_Unload(Cancel As Integer)
    If rec.State = 1 Then rec.Close
    Set rec = Nothing
    End
End Sub

⌨️ 快捷键说明

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