Results 1 to 5 of 5
  1. #1
    Join Date
    May 2004
    Posts
    6

    Unanswered: Identifying old records by the User which created them!!!

    I have now found a way to keep a log of the Users who create / update new records in a form within my database. However, this now only provides the Users who create / ammend new records...


    Is there any way I can obtain Users who created all previous records???

    Somebody please help!!!

  2. #2
    Join Date
    Aug 2004
    Posts
    40
    Nope! Once the ldb file has been closed there is no way to determine the input user. (that I'm aware of ).

    Howard

  3. #3
    Join Date
    May 2004
    Posts
    159
    Care to share you method? I have been thinking of doing that too and would like to see an example.

  4. #4
    Join Date
    Aug 2004
    Posts
    40
    This is a bit of code I use. It gets the name of the computer the data is being entered from. I can't remember where it came from so I humbly apologize to the author of whom credit must go.

    As the prog this is being used in doesn't have any login procedure, the computer name is the only thing available.

    First add a new field to table you wish to store the computer's name into (say entryby with text 30). Put this next bit in somewhere accessible (say a module)

    Code:
    Option Compare Database
    Option Explicit
    Private Declare Function apiGetComputerName Lib "kernel32" Alias _
        "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
    -------------------------------------------------
    Function fOSMachineName() As String
    'Returns the computername
    Dim lngLen As Long, lngX As Long
    Dim strCompName As String
        lngLen = 16
        strCompName = String$(lngLen, 0)
        lngX = apiGetComputerName(strCompName, lngLen)
        If lngX <> 0 Then
            fOSMachineName = Left$(strCompName, lngLen)
        Else
            fOSMachineName = ""
        End If
    End Function
    Then it's just a simple case of calling the function and storing the info into a hidden field (the one you created earlier) on your form. Like so...

    Code:
    me!entryby = fOSMachineName
    HTH

    Howard

  5. #5
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    I thank you for that code. I may have to use that one myself. I was using another method since I have a login, but I am not sure when I rebuild my database if I want to go that route or not so you have helped me solve one reason of going that route.

    Thanks,
    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •