W
Wizneber
Wizneber said:I am using a MS data access page that allows people to update survey results.
I would like to create a log of who submits changes. Prefferable I would like
to log the host name of the computer submitting the change but anything (IP
address, windows login, etc...) would be great.
I know that Access Forms are the preffered method updating records and
logging but that is not an option in this case. Any help or suggestions would
be appreciated.
Thanks,
Wizneber
After some searching I found the follwoing code which should create and
update a table to log the changes but it is not doing anything. I complie and
it generates no errors but it does not create the table. I am a complete
novice to programming anyone have suggestions?
<SCRIPT language=vbscript event=onafterupdate for=DealerCode>
<!--
Dim strCmd
Dim time
Dim empID
strCmd = "CREATE TABLE UpdateInsertLog ([Time] DATETIME, [Type] CHAR,
EmployeeID CHAR);"
' Use On Error to suppress error messages resulting from trying to
' create a table that already exists.
On Error Resume Next
' Insert log table.
MSODSC.Connection.Execute strCmd
' Turn VBS error handling back on.
On Error Goto 0
time = Now()
empID = System.Net.Dns.GetHostName
' Insert log information.
strCmd = "INSERT INTO UpdateInsertLog VALUES ('" & time & "', 'Update', " &
empID & ");"
MSODSC.Connection.Execute strCmd
-->
</SCRIPT>