The User Roster

Access 2000 introduced the user roster. The user roster allows you to programmatically determine who is logged on to a database. The OpenSchema method of the Connection object provides this information.

The OpenSchema method receives three parameters. They include Query Type, Restrictions, and Schema ID. Listing 2.15 illustrates the use of the OpenSchema method to identify the user roster.

Listing 2.15. Determining Who Is Using a Database
 Public Const JET_SCHEMA_USERROSTER = _ "{947bb102-5d43-11d1-bdbf-00c04fb92675}" Sub UserRoster() Dim cnn As ADODB.Connection Dim rst As ADODB.Recordset Set cnn = New ADODB.Connection cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=C:\My Documents\Test.mdb" cnn.Open ...

Get Alison Balter's Mastering Access 2002 Enterprise Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.