Solved

How to do the event log in Access 97?

Posted on 1997-12-16
5
229 Views
Last Modified: 2012-08-13
Hello!

      I like to know how to provided the event log in Access 97 by using the security provided by Access 97. Is mean that the I not need to create my own password form screen
by weitten coding in module instead to create the event log. have any shortcut to doing .

    Thank you!


sean yeo

0
Comment
Question by:seanyeo
  • 3
5 Comments
 
LVL 12

Expert Comment

by:Trygve
Comment Utility
Could you please refrase the question.

Do you want to log the users activity or do you want to do user administration ?
0
 
LVL 9

Expert Comment

by:cymbolic
Comment Utility
In VBA 5.0, there are two new methods on the app object, .startlogging and .logevent that allow you to place items in the system (or if 95, your own) event log.
0
 
LVL 12

Expert Comment

by:Trygve
Comment Utility
No such thing as .startlogging and .logevent in Access 97 as far as I know.
0
 

Author Comment

by:seanyeo
Comment Utility
Beside the VB5.0 Method, have anyway to do it in Access 95.
0
 
LVL 12

Accepted Solution

by:
Trygve earned 60 total points
Comment Utility
If you want to keep track of the user activity: which forms they open, reports preview/printed macros executed etc. the best thing to do is to make an EventLog table. Something like this might do the trick:

Login     ' UserID
DateTime  '  
EventType ' OpenReport, OpenForm etc.
Object    ' Name of object handeled.

Then when you open a report from a button or otherwise the following lines of code will log the event

dim EventType as string
dim ObjectToHandle
TypeOfEvent="PreviewReport"
ObjectToHandle="MyReportName"

DoCmd.RunSQL "INSERT INTO SD_EventLog ( Login, [DateTime], EventType, Object ) SELECT DISTINCTROW CurrentUser() AS Login, Now() AS [DateTime], '" & TypeOfEvent & "' AS EventType, '" & ObjectToHandle & "' AS Object;"

The code can be easily adapted to your needs.

The CurrentUser() function is used to ID the user. This function returns the ID the user logged on to Access with.


Hope this helps!
Trygve
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now