Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Multiuser / Networking / February 2006

Tip: Looking for answers? Try searching our database.

Who is logged on?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Leslie Isaacs - 07 Feb 2006 17:26 GMT
Hello All

I am using A2K, and have used the code at
http://support.microsoft.com/?id=198755 to find out who is logged on.

1) Rather that having to open the Immediate Window in the Visual Basic
Editor and then typing ShowUserRosterMultipleUsers, is it possible to run
this facility by clicking a button - what would be the OnClick event
procedure?

2) Is it possible to get the list of users to include the objects (forms
etc) that they have open?

I would be very grateful for any help.

Many thanks
Leslie Isaacs
Douglas J. Steele - 07 Feb 2006 22:49 GMT
> Hello All
>
[quoted text clipped - 5 lines]
> this facility by clicking a button - what would be the OnClick event
> procedure?

The Click event for your button would call ShowUserRosterMultipleUsers. Of
course, that will still write the output to the Immediate Window. If you
wanted to change that, you'd need to replace the Debug.Print line.

> 2) Is it possible to get the list of users to include the objects (forms
> etc) that they have open?

No, it's not possible.

Signature

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

Leslie Isaacs - 08 Feb 2006 10:21 GMT
Hello Douglas

Thanks for your reply.
What would I change the Debug.Print line to? I would be happy for the list
of users to be displayed as a datasheet, or a report, or on a form, or
whatever!

Thanks again.
Les

>> Hello All
>>
[quoted text clipped - 14 lines]
>
> No, it's not possible.
Douglas J. Steele - 09 Feb 2006 00:41 GMT
You could write the data to a table (using an INSERT INTO SQL statement
would probably be the easiest), or you could populate an array or collection
with the information, or you could write a user-defined function that acts
as the RowSource for a listbox
http://msdn.microsoft.com/library/en-us/vbaac11/html/acproRowSourceTypeFunctionP
arameters_HV05187987.asp


Signature

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

> Hello Douglas
>
[quoted text clipped - 24 lines]
>>
>> No, it's not possible.
Adam Thwaites - 28 Feb 2006 11:29 GMT
I made a form with 4 tall text boxes (txt0,txt1,txt2,txt3) next to each other
and use the following code:

Private Sub cmdShowUser_Click()

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.

txt0 = rs.Fields(0).Name
txt1 = rs.Fields(1).Name
txt2 = rs.Fields(2).Name
txt3 = rs.Fields(3).Name

While Not rs.EOF
   txt0 = txt0 & vbCrLf & (Left(rs.Fields(0), (Len(RTrim(rs.Fields(0))) -
1)))
   txt1 = txt1 & vbCrLf & (Left(rs.Fields(1), (Len(RTrim(rs.Fields(1))) -
1)))
   txt2 = txt2 & vbCrLf & rs.Fields(2)
   If rs.Fields(3) = 1 Then
   txt3 = txt3 & vbCrLf & "1"
   Else
   txt3 = txt3 & vbCrLf & "Null"
   End If
   rs.MoveNext
Wend

End Sub

This lists all the data on a form.
Signature

Adam Thwaites
Access Database Designer
adam.*spamless*thwaites@mercedes.co.uk
Manchester, UK

> You could write the data to a table (using an INSERT INTO SQL statement
> would probably be the easiest), or you could populate an array or collection
[quoted text clipped - 30 lines]
> >>
> >> No, it's not possible.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.