Author Topic: 儲存系統使用記錄的樣本程序  (Read 4039 times)

admin

  • Administrator
  • *****
  • Posts: 0
    • View Profile
儲存系統使用記錄的樣本程序
« on: October 08, 2010, 01:15:30 AM »
儲存系統使用記錄的樣本程序

Code: [Select]
Sub SaveNewSysLog(InputUser As String, InputPCName As String, InputPlatform As Integer, InputFunct As String, inputKey As String, Optional InputDateTime As Double = 0)
  dim tmpLogRecord as DatabaseRecord
  tmpLogRecord = New DatabaseRecord
 
  if InputDateTime=0 then
    dim now as new date
    tmpLogRecord.DoubleColumn("logdatetime")=datetodbl(now)
  else
    tmpLogRecord.DoubleColumn("logdatetime")=inputdatetime
  end if
  tmpLogRecord.Column("loguname")=inputuser                  '這個方法使用任何Quotation Mark 也沒有問題 chr(34)+"'"
  tmpLogRecord.Column("logpcname")=inputpcname
  tmpLogRecord.Column("logfunct")=inputfunct
  tmpLogRecord.Column("logkeycode")=inputkey
  tmpLogRecord.IntegerColumn("logplatform")=InputPlatform
  gdbconnection.InsertRecord("syslog",tmplogrecord)
 
  If gdbconnection.Error= False then
    gdbconnection.commit
  else
    gdbConnection.rollback
  end if
 
Exception Err
  CatchErrorType(Err,CurrentMethodName)
 
End Sub
« Last Edit: October 08, 2010, 01:18:41 AM by Roy Chan »