log.cls

来自「金算盘软件代码」· CLS 代码 · 共 53 行

CLS
53
字号
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "Log"
Attribute VB_GlobalNameSpace = True
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'  上机日志类
'  作者:黄涛
'  日期:1998.02.21
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Option Explicit

Private mrecLog As Recordset                            '上机日志表

Private Sub Class_Initialize()
    Set mrecLog = gdbDataBase.OpenRecordset("Log", dbOpenTable)
End Sub

Private Sub Class_Terminate()
    mrecLog.Close
    Set mrecLog = Nothing
End Sub

Public Function LogIn(ByVal lngOperatorID As Long, ByVal strMachoineName As String, ByVal lngFormCaptionRCID As Long) As Long
    With mrecLog
        .AddNew
        !lngOperatorID = lngOperatorID
        !strMachineName = strMachoineName
        !lngFormCaptionRCID = lngFormCaptionRCID
        !dtmLoginTime = Now
        LogIn = !lngLogID
        .Update
    End With
End Function

Public Sub LogOut(ByVal lngLogID As Long)
    With mrecLog
        .Index = "PrimaryKey"
        .Seek "=", lngLogID
        If Not .NoMatch Then
            .Edit
            !dtmLogoutTime = Now
            .Update
        End If
    End With
End Sub


⌨️ 快捷键说明

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