Hi,
I think this is the code that you are expecting to see:
Private Sub sUseUserRoster()
' Modified version of code found in the following KB Article
' Q198755 -
http://support.microsoft.com/support/kb/articles/Q198/7/55.ASP
' ACC2000: Checking Who Logged into Database with Jet UserRoster
'
On Error GoTo ErrHandler
Dim cn As Object
Dim Rs As Object
Dim i As Integer
Const adSchemaProviderSpecific = -1
Set cn = CreateObject("ADODB.Connection")
Set Rs = CreateObject("ADODB.Recordset")
cn.Provider = "Microsoft.Jet.OLEDB.4.0"
cn.Open "Data Source=" & Me.txtDBPath
' The user roster is exposed as a provider-specific schema rowset
' in the Jet 4 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}")
m_tLDBInfo.strErrorMsg = vbNullString
With m_tLDBInfo
If Rs.EOF Then
Stop
Else
Do While Not Rs.EOF
ReDim Preserve .atLUI(i)
.atLUI(i).strMachineName = Rs(0)
.atLUI(i).strUserName = fGetRemoteLoggedUserID(Rs(0))
.atLUI(i).strLoginName = Rs(1)
.atLUI(i).blnConnected = Rs(2)
.atLUI(i).varSuspectState = Rs(3)
Rs.MoveNext
.intUserCount = i
i = i + 1
Loop
End If
Me.lblUserCount.Caption = .intUserCount
End With
ExitHere:
On Error Resume Next
Rs.Close
Set Rs = Nothing
cn.Close
Set cn = Nothing
Exit Sub
ErrHandler:
With Err
MsgBox "Error: " & .Number & vbCrLf & .Description, _
vbCritical Or vbOKOnly, .Source
End With
Resume ExitHere
End Sub
Do let me know if this isn't the one.
Thanks