Tracking

uksoldier

Registered User.
Local time
Today, 08:39
Joined
Jan 26, 2003
Messages
17
I have databases in a shared folder. As normal when a DBase is opened an ldb file is open.

What I would like to do is for me as the DBase Manager to know who is on the DBase, when they first accessed it and how many records are input by that user.

Anyone have an idea? know a good free programme that can do it for me ?
 
Hi

Assuming you are using a network you can use this code;

Go to the Modules tab, click on New. Paste this in exactly as written:

code:
--------------------------------------------------------------------------------

Option Compare Database
Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Function fOSUserName() As String
' Returns the network login name
Dim lngLen As Long, lngX As Long
Dim strUserName As StringstrUserName = String$(254, 0)lngLen = 255lngX = apiGetUserName(strUserName, lngLen)
If lngX <> 0 Then
fOSUserName = Left$(strUserName, lngLen - 1)Else
fOSUserName = ""
End If
End Function

--------------------------------------------------------------------------------

It doesn't matter what you name the module when you save it. Only the function name matters.

You could then put a hidden field on the input form to show the UserName (by calling this function) and post that to the table with a date. Then you could have a query to pick up who input what and when.

Col
:cool:
ps - thanks to David R for the fosUser code
 

Users who are viewing this thread

Back
Top Bottom