Display all users who are logged on to .MDE

  • Thread starter D M via AccessMonster.com
  • Start date
D

D M via AccessMonster.com

F/End is Access 2003 . B/End tables are SQL 2000. I have used the MS KB285822
code below and it works fine for .MDB. However it does not work for .MDE.
What do I need to amend to get it to work for .MDE ??



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
 
M

Michel Walsh

Hi,

You are likely to only get the actual user, on the front end connection,
cn, assuming each end user has its own private front-end.

If the back end is MS SQL Server, I would rather use sp_who, a
predefined tsql stored procedure (from database master, from which each
"working" db inherit).



Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top