Determine who is logged on to an Access 2010 database

The following code is supposed to determine what users are logged on to an Access DB.  It was received from http://support.microsoft.com/kb/285822.  I created a module named ShowUsers as instructed, and am using Microsoft ActiveX Data Objects 6.1 Library.  The code compiles but when I open the Immediate window, type ShowUserRosterMultipleUsers and press enter, nothing happens.  I also closed and reopened the file to try again but nothing changed.  I'm using Access 2010 in a Citrix environment and don't know if that impacts what is supposed to happen.

Sub ShowUserRosterMultipleUsers()
    Dim cn As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    Dim i, j As Long

    Set cn = CurrentProject.Connection

    ' The user roster is exposed as a provider-specific schema rowset
    ' in the Jet 4.0 OLE DB provider.  You have to use a GUID to
    ' reference the schema, as provider-specific schemas are not
    ' listed in ADO's type library for schema rowsets

    Set rs = cn.OpenSchema(adSchemaProviderSpecific, _
    , "{947bb102-5d43-11d1-bdbf-00c04fb92675}")

    'Output the list of all users in the current database.

    Debug.Print rs.Fields(0).Name, "", rs.Fields(1).Name, _
    "", rs.Fields(2).Name, rs.Fields(3).Name

    While Not rs.EOF
        Debug.Print rs.Fields(0), rs.Fields(1), _
        rs.Fields(2), rs.Fields(3)
        rs.MoveNext
    Wend

End Sub

Currently I'm the only user logged into the file so would expect my user ID to appear.  Please advise if I must do something else to make this process work.
Liberty4allAsked:
Who is Participating?
 
PatHartmanCommented:
I will send the link to you personally.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Not sure what is going on, but keep in mind this is only going to (mainly) return the Computer Name(s) of any users connected.  It does not return the Windows user name or any 'real name'

Also, I'm not sure ... that code works on the ACCDB format ?
0
 
Jeffrey CoachmanMIS LiasonCommented:
The code worked for me in a accdb...
FWIW, I was using the Active x 2.1 library, ...not the 6.1 you are using....

screen
JeffCoachman
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Hey Jeff ... MIA bro.

Guess that clears up the ACCDB concern.

Joe
0
 
Jeffrey CoachmanMIS LiasonCommented:
taking this year off...
;-)
0
 
Liberty4allAuthor Commented:
Since I need to use the ActiveX Data Objects 6.1 Library and ActiveX Data Objects Recordset 6.0 Library should I conclude it's not possible to make this work in my situation?

I will look at the link at UtterAccess to see if that helps.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
"I will look at the link at UtterAccess to see if that helps."
That utility definitely works.  In fact, coincidentally ... I am - as we speak - modifying it for special needs I have here at work.


@ Pat ... that link will probably get deleted by the mods ....
mx
0
 
PatHartmanCommented:
Better use it quickly then:)
0
 
Liberty4allAuthor Commented:
Pat, the link to the article on UtterAccess.com was removed before I could copy it.  Can you please repost it?  If doing so is against Experts Exchange policy please advise and I will close my question.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
EE does  not allow links to competitive sites.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Umm ... Pat ... you have to keep the discussion within EE ... :-)
0
 
Liberty4allAuthor Commented:
I have not tested the solution but if I need help with it will pursue that in another forum.
0
 
PatHartmanCommented:
Joe,
We are not discussing anything.  I don't understand why you are so determined to keep me from telling Liberty4all where to find the tool he needs.  If you don't want people to talk privately, remove the private messaging feature!!!!

People pay for a subscription to this forum because there are a number of people who provide excellent answers, quickly.  With the free forums, the response time is almost always greater and the answers are not as good.

You really don't need to be afraid of the competition.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
It's not me :-)
Mods monitor these questions and frown on anything to do with direct competitive sites.
0
 
PatHartmanCommented:
Thanks Jim.  But, what is your suggestion for this situation?  Do you want content copied here where it is disconnected from its source and will almost certainly become outdated?
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
I'm pretty sure Brent (Spaulding aka datadrenaline) would have no problem with someone uploading the Who Is Connected db here.  His copyrights are contained within the db ... basically free to use as long a copyright remains intact.
I'm currently created an A2013 version of it with a Ribbon and so on - some additional enhancements - and will then give to him - as a ... .surprise :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.