Private Const JET_SCHEMA_USERROSTER = "{947bb102-5d43-11d1-bdbf-00c0­4fb92675}" Public Function LimitUsers(iNumber As Integer) As Boolean 'Compare the number of database users to a provided number, 'and if greater, shutdown the current database instance. Dim rs As ADODB.Recordset Dim iCtr As Integer 'Make sure the programmer allows at least one user. If iNumber = 1 Then iNumber = 2 'Open the roster. Set rs = CurrentProject.Connection.Open­Schema( _ adSchemaProviderSpecific, , JET_SCHEMA_USERROSTER) 'rs.RecordCount doesn't work reliably here, so we need to cycle 'through the recordset to count the number of users. Do While Not rs.EOF iCtr = iCtr + 1 'If the number of users exceeds iNumber, then shutdown the 'current database instance. If iCtr > iNumber Then GoTo Proc_Shutdown rs.MoveNext Loop 'Clean up rs.Close Set rs = Nothing Exit Function Proc_Shutdown: 'Clean up before shutting down the current database instance. rs.Close Set rs = Nothing Application.Quit End Function