Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2004
    Posts
    83

    Unanswered: Knowing who is signed onto the DB...

    Is it possible to programmibly know who is signed onto the DB, and therefore be able to Log who updated a record?

    Thanks,
    Steve

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: Knowing who is signed onto the DB...

    Originally posted by High_D
    Is it possible to programmibly know who is signed onto the DB, and therefore be able to Log who updated a record?

    Thanks,
    Steve
    CurrentUser

  3. #3
    Join Date
    Nov 2003
    Location
    Danbury,ct 06801
    Posts
    24

    Re: Knowing who is signed onto the DB...

    try microsoft web site i found some utility witch is similiar to what your r looking for

    serch this "LDBView.exe"

    i think that might help

    hiten
    hbhavsar

  4. #4
    Join Date
    Mar 2004
    Posts
    83
    Perfect guys thanks thats exactly what I needed. I didn't see CurrentUser in the object browser. Now is there also a class to detect when a record has been updated so I can timestamp it?

  5. #5
    Join Date
    Sep 2003
    Location
    Lancashire, UK
    Posts
    22
    CurrentUser is only useful if you have Workgroups set up.
    If you want to know who is logged onto the PC then do the following

    Declare global constant
    Code:
    Public g_strUser As String
    Declare a function in the advapi32.dll.
    Code:
    Public Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
    Next have a startup procedure call the following code
    Code:
    g_strUser = String(255, 0)
    GetUserName g_strUser, 255
    g_strUser = Left$(g_strUser, InStr(g_strUser, Chr$(0)) - 1)
    g_strUser will now hold the user who is logged onto the PC

  6. #6
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by Robbo
    CurrentUser is only useful if you have Workgroups set up.
    If you want to know who is logged onto the PC then do the following

    Declare global constant
    Code:
    Public g_strUser As String
    Declare a function in the advapi32.dll.
    Code:
    Public Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
    Next have a startup procedure call the following code
    Code:
    g_strUser = String(255, 0)
    GetUserName g_strUser, 255
    g_strUser = Left$(g_strUser, InStr(g_strUser, Chr$(0)) - 1)
    g_strUser will now hold the user who is logged onto the PC
    CurrentUser has a weakness and so does your idea ... If workgroups is turned on then you can log in as any user account ... Then the question becomes Who are you????

Posting Permissions

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