Logging Host Name on save using MS Data Access Page

W

Wizneber

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
 
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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top