access db logon list STILL looking for code help
I just found this code (most of it) right here a couple of days ago. It is for the purpose of finding out who is logged on to an access db and co-incidentally a guy down the hall asked me to help him do just that so I thought I'd try to get this to work for me. I've lost track of the thread I sucked it off of and can't find it in search.
my db connection opens just fine but I get error message 3251 "operator or provider is not capable of performing requested operation" at the line commented below.
I commented out the line "If adxUsr.Name = cmbLogonId " 'cause it was giving a compiler error and I figured I"d get back to it when I got the rest working, but execution is halting at the commented line.
I'm flying somewhat blind on this since I have not used these constructs before (catalog / group / user). On-line help isn't helping, but that's a common problem for me.
My db references are
MS ActiveX Data Objects 2.7 Library
MS ADO Ext. 2.7 for DLL and Security
VB Code:
Option Explicit
Public cn As ADODB.Connection
'
' close db on cmd button pushed
'
Private Sub cmdClose_Click()
cn.Close
Set cn = Nothing
End Sub
'
' open db on cmd button pushed
'
Private Sub cmdOpen_Click()
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & "M:\SVC DEL COORD\open_items97.mdb"
cn.Open
End Sub
'
' find user on cmd button pushed
'
Private Sub Command1_Click()
Dim adxCat As ADOX.Catalog
Dim adxGrp As ADOX.Group
Dim adxUsr As ADOX.User
Dim cnt As Integer
Set adxCat = New ADOX.Catalog
Set adxGrp = New ADOX.Group
cnt = 1
adxCat.ActiveConnection = cn
For Each adxGrp In adxCat.Groups ' <== ERROR MSG HERE <==
lstGroups.AddItem adxGrp.Name
cnt = cnt + 1
Next
Set adxCat = New ADOX.Catalog
Set adxGrp = New ADOX.Group
Set adxUsr = New ADOX.User
For cnt = 0 To lstGroups.ListCount - 1
lstGroups.Selected(cnt) = False
Next cnt
Set adxCat = New ADOX.Catalog
Set adxUsr = New ADOX.User
Set adxGrp = New ADOX.Group
adxCat.ActiveConnection = cn
For Each adxUsr In adxCat.Users
' If adxUsr.Name = cmbLogonId Then
For Each adxGrp In adxUsr.Groups
For cnt = 0 To lstGroups.ListCount - 1
If adxGrp.Name = lstGroups.List(cnt) Then
lstGroups.Selected(cnt) = True
End If
Next cnt
Next
' End If
Next
Set adxGrp = Nothing
Set adxUsr = Nothing
Set adxCat = Nothing
End Sub
any help will be appreciated