Re: Who Is Logged On?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



It's not a case of "adding each user as an administrator". Unless you apply
Access User-Level Security, every user is Admin by default.

Note that adding ULS isn't something to be taken lightly. Check out the
Access Security FAQ at
http://support.microsoft.com/support/access/content/secfaq.asp

Read it thoroughly several times, and work with a copy of your application
(just in case...). Make sure you don't leave out any steps.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"EarlCPhillips" <EarlCPhillips@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:34EA69B5-C7AC-467A-90F2-FFD2546F66E9@xxxxxxxxxxxxxxxx
I used the code provided by Alex Dybenco and it works. Actually I combined
code from Douglas Steele and Alex. The problem seems to be intractable
because someone here gave everyone Admin authority so each record found
lists
"computer name" and "admin" for every user. I am hosed unless someone can
enlighten me on how the powers that be at Harvesters should add
authorization
by name rather than adding each user as an administrator. Any help on
that
would be appreciated.

EarlCPhillips
ExMainframer Learning Access To Help
Feed The Hungry More Efficiently
Harvesters Community Food Network
--
Trying To Feed The Hungry


"EarlCPhillips" wrote:

Doug's answer gives me the computer names, not the user names. Unless I
can
get a cross-reference from the IT manager, this will not work. I will
try
some of the other suggestions and see how they work.

EarlCPhillips
--
Trying To Feed The Hungry


"Daniel Pineault" wrote:

I do not have a solution as to why your code does not work, perhaps
Douglas
will be able to help you with that, but I do have an alternative. Take
alook
at

http://groups.google.ca/group/microsoft.public.access.multiuser/browse_thread/thread/e4ca538f024b5b24/57dcea37e26fd10d?hl=en&lnk=st&q=ms+access+WhosOn#57dcea37e26fd10d

Alex Dybenko has a relatively simple code to do this.

Also

How to determine who is logged on to a database by using Microsoft Jet
UserRoster in Access 2000
http://support.microsoft.com/?id=198755

How to determine who is logged on to a database by using Microsoft Jet
UserRoster in Access 2002 or in Access 2003
http://support.microsoft.com/?id=285822

Lastly the following poat has numerous good links concerning db user
tracking...
http://groups.google.ca/group/microsoft.public.access.security/browse_thread/thread/8b76a79c4effb3d7/1ea481f2b802de42?hl=en&lnk=st&q=ms+access+WhosOn#1ea481f2b802de42
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.com/index.php
Please rate this post using the vote buttons if it was helpful.



"EarlCPhillips" wrote:

From "Automatine Microsoft Access With VBA" by Susan Sales Harkins
and Mike
Gunderloy published by Que Publishing, 2005, ISBN 0-7897-3244-0, I
took a
routine from page 250-1 which publishes a function which gives
something to
see who is connected to the database. I cannot get it to work for
me. The
code is as follows:
Public Const JET_SCHEMA_USERROSTER =
"{947bb102-5d43-11d1-bdbf-00c04fb92675}"
Public Function ReturnUsers() As String
On Error GoTo Err_ReturnUsers
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Set cnn = New ADODB.Connection
Set rst = New ADODB.Recordset
'open connection to database
Set cnn = CurrentProject.Connection
'open schema recordset to grab user metadata
Set rst = cnn.OpenSchema(adSchemaProviderSpecific, , _
JET_SCHEMA_USERROSTER)
'return current users
rst.MoveFirst
Do Until rst.EOF
ReturnUsers = rst(0) & ":" & ReturnUsers
rst.MoveNext
Loop

Exit_ReturnUsers:
rst.Close
Set rst = Nothing
cnn.Close
Set cnn = Nothing
Exit Function
Err_ReturnUsers:
MsgBox "Error " & Err.Number & ": " & Err.Description
Resume Exit_ReturnUsers
End Function

I built a form that contains a list box. The code to activate the
form is:
Private Sub Form_Load()
On Error GoTo Err_Form_Load
Dim strUsers As String
'populate listbox with current users
strUsers = ReturnUsers
lstCurrentUsers.ControlSource = strUsers
Exit_Form_Load:
Exit Sub
Err_Form_Load: 'handles any error condition
MsgBox "Error number: " & Err.Number & vbCr & Err.Description
Resume Exit_Form_Load
End Sub

What am I doing wrong? Any suggestions?

EarlCPhillips
Ex-Mainframer Learning Access to Make
Local Food Bank Feed Hungry More Efficiently
Harvesters Community Food Network
--
Trying To Feed The Hungry


.


Quantcast