Solved

Determine who is logged on to an Access 2010 database

Posted on 2014-10-02
18
1,856 Views
Last Modified: 2014-10-09
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.
0
Comment
Question by:Liberty4all
  • 7
  • 4
  • 3
  • +1
18 Comments
 
LVL 75
ID: 40357737
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
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 40357794
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
 
LVL 75
ID: 40357804
Hey Jeff ... MIA bro.

Guess that clears up the ACCDB concern.

Joe
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 40357811
taking this year off...
;-)
0
 

Author Comment

by:Liberty4all
ID: 40357834
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
 
LVL 75
ID: 40357851
"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
 
LVL 34

Expert Comment

by:PatHartman
ID: 40357864
Better use it quickly then:)
0
 

Author Comment

by:Liberty4all
ID: 40371004
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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 75
ID: 40371126
EE does  not allow links to competitive sites.
0
 
LVL 34

Accepted Solution

by:
PatHartman earned 500 total points
ID: 40371266
I will send the link to you personally.
0
 
LVL 75
ID: 40371361
Umm ... Pat ... you have to keep the discussion within EE ... :-)
0
 

Author Closing Comment

by:Liberty4all
ID: 40371464
I have not tested the solution but if I need help with it will pursue that in another forum.
0
 
LVL 34

Expert Comment

by:PatHartman
ID: 40371500
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
 
LVL 75
ID: 40371509
It's not me :-)
Mods monitor these questions and frown on anything to do with direct competitive sites.
0
 
LVL 34

Expert Comment

by:PatHartman
ID: 40371755
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
 
LVL 75
ID: 40371845
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now