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.
Liberty4allRetiredAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
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
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Hey Jeff ... MIA bro.

Guess that clears up the ACCDB concern.

Joe
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Jeffrey CoachmanMIS LiasonCommented:
taking this year off...
;-)
0
Liberty4allRetiredAuthor 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 Architect / Systems AnalystCommented:
"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
Liberty4allRetiredAuthor 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 Architect / Systems AnalystCommented:
EE does  not allow links to competitive sites.
0
PatHartmanCommented:
I will send the link to you personally.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Umm ... Pat ... you have to keep the discussion within EE ... :-)
0
Liberty4allRetiredAuthor 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 Architect / Systems AnalystCommented:
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 Architect / Systems AnalystCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.