📄 log.cls
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -