儲存系統使用記錄的樣本程序
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