Hi all,
Great day(:
I have a database stored in the shared drive and currently the records are being changed mysteriously. Is there a function in MS Access that allows you to check who was the last person who used the database or who was the one who changed a record?
Many thanks for all the help received(:
Cheers,
Nicole
Assuming you have User-Level Security defined, you can Log each User's opening and closing of the Database by writing to a Hidden Table, then easily retriving that information. You can use something similar to: - Dim strSQL As String
-
-
strSQL = "INSERT INTO tblLastUser ([UserName], [UsageTime]) VALUES (CurrentUser(), Now())"
-
-
CurrentDb.Execute strSQL, dbFailOnError
To retrieve the Last User's Name and Time Logged on: - MsgBox "Last User: " & DLast("[UserName]", "tblLastUser") & vbNewLine & _
-
"Last Access: " & DLast("[UsageTime]", "tblLastUser")
Example: - Last User: Admin
-
Last Access: 2/11/2010 9:20:29 AM
4 2988
Assuming you have User-Level Security defined, you can Log each User's opening and closing of the Database by writing to a Hidden Table, then easily retriving that information. You can use something similar to: - Dim strSQL As String
-
-
strSQL = "INSERT INTO tblLastUser ([UserName], [UsageTime]) VALUES (CurrentUser(), Now())"
-
-
CurrentDb.Execute strSQL, dbFailOnError
To retrieve the Last User's Name and Time Logged on: - MsgBox "Last User: " & DLast("[UserName]", "tblLastUser") & vbNewLine & _
-
"Last Access: " & DLast("[UsageTime]", "tblLastUser")
Example: - Last User: Admin
-
Last Access: 2/11/2010 9:20:29 AM
Hi ADezii,
By saying" Assuming you have User-Level Security defined, you can Log each User's opening and closing of the Database by writing to a Hidden Table"
Could you elaborate more about the User-Level Security as i have no idea what that is about. And also with regards to the Hidden Table,does this mean i have to create a new table?
Sorry for the many question, this is all very new to me. Where will i have to put the codes? Do i have to put it in each table and is there a button i can cliick to retrieve the info for the last person using the DB.
Thanks in advance for all your help ADezii, appreciate it heaps(:
Cheers,
Nicole
NeoPa 32,556
Expert Mod 16PB
User-Level is a bit of a dead duck now. I believe they don't even support it going forward from A2007.
However, this does open my eyes a little (Thanks ADezii). I was assuming, quite sleepily, that you were asking for a general concept of how to determine such usage (IE. for any unmodified database). For a particular database you could always log the user accesses. In place of the Access level user though (almost all Access users simply use Administrator for all purposes) you could use the network user, or simple account name if the user is not networked. Function to Return UserName (NT Login) of Current User and Retrieve User ID will help to get those details. ADezii's code and explanation gives the basic idea of how to go about this.
NeoPa 32,556
Expert Mod 16PB @nicolenwn
Yes it would. You could hide it from the users as ADezii has suggested if that helps, but you'd need a table to log the access times into.
It could be done by logging to an outside file, but that would be appreciably more complicated and somewhat less logical.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Drifter |
last post by:
Using HTTP_REFERER I cannot capture the URL when the link is made via a
button:
<input type="button" name="Continue" value="Continue Shopping"...
|
by: Robert |
last post by:
Greetings,
I have been attempting to develop a useful and functional template for
database tracing/profiling that will enable me to collect metrics for
performance tuning. The database is used...
|
by: FAQPoster |
last post by:
An HTML version of this document is available at:
http://www.mvps.org/access/netiquette.htm
Feeling left out? Alone? Wondering why everyone's ignoring you?
Or why you're being flamed for what...
|
by: latosca68 |
last post by:
I need to demostrate, in a forensic job, that I can change (insert,
update, delete) records in a table of an access database without
trace. How can I do
this ? I plan to make the queries or export...
|
by: dauwe.peter |
last post by:
A table : Nameperson, Book nr, Bookdatein, Bookdateout, CD nr,
cddatein, cddateout, dvd nr, dvddatein, dvddateout.
I would like a query where a see the personsname en de last book with
the...
|
by: twomcfly |
last post by:
Hi
I have a SQL Server 2005 database with a list of results for a variety of people over time. i would like to be able to look at any row and from that row know the last 3 results for that person...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |