Solved

Determine who is logged on to an Access 2010 database

Posted on 2014-10-02
18
1,722 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
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 …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

708 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

15 Experts available now in Live!

Get 1:1 Help Now