定义一个 全局变量Gstrname,在登录时候赋值
定义一个函数添加用于登陆日记,参数strlog为状态:登录,退出
Public Sub AddLog(ByVal strLog As String)
Dim strSqlLog As String, strTmpLog As String
strTmpLog = "'" & Now & "','" & gstrName & "','" & strLog & "'"
strSqlLog = "insert into TBLOG(logtime,logname,logtext)values(" & strTmpLog & ")"
Call ExecuteSQL(strSqlLog)
end sub
ExecuteSQL为查询函数,TBLOG为数据库中 日志表
你可以参照这写
不难