Results 1 to 9 of 9

Thread: access db logon list STILL looking for code help

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2001
    Location
    new jersey
    Posts
    2,904

    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:
    1. Option Explicit
    2. Public cn As ADODB.Connection
    3. '
    4. ' close db on cmd button pushed
    5. '
    6. Private Sub cmdClose_Click()
    7.     cn.Close
    8.     Set cn = Nothing
    9. End Sub
    10. '
    11. ' open db on cmd button pushed
    12. '
    13. Private Sub cmdOpen_Click()
    14.     Set cn = New ADODB.Connection
    15.     cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    16.                 "Data Source=" & "M:\SVC DEL COORD\open_items97.mdb"
    17.     cn.Open
    18. End Sub
    19. '
    20. ' find user on cmd button pushed
    21. '
    22. Private Sub Command1_Click()
    23.     Dim adxCat As ADOX.Catalog
    24.     Dim adxGrp As ADOX.Group
    25.     Dim adxUsr As ADOX.User
    26.     Dim cnt As Integer
    27.  
    28.     Set adxCat = New ADOX.Catalog
    29.     Set adxGrp = New ADOX.Group
    30.  
    31.     cnt = 1
    32.  
    33.     adxCat.ActiveConnection = cn
    34.     For Each adxGrp In adxCat.Groups ' <== ERROR MSG HERE <==
    35.         lstGroups.AddItem adxGrp.Name
    36.         cnt = cnt + 1
    37.     Next
    38.  
    39.     Set adxCat = New ADOX.Catalog
    40.     Set adxGrp = New ADOX.Group
    41.     Set adxUsr = New ADOX.User
    42.  
    43.     For cnt = 0 To lstGroups.ListCount - 1
    44.         lstGroups.Selected(cnt) = False
    45.     Next cnt
    46.  
    47.     Set adxCat = New ADOX.Catalog
    48.     Set adxUsr = New ADOX.User
    49.     Set adxGrp = New ADOX.Group
    50.  
    51.     adxCat.ActiveConnection = cn
    52.  
    53.     For Each adxUsr In adxCat.Users
    54. '        If adxUsr.Name = cmbLogonId Then
    55.             For Each adxGrp In adxUsr.Groups
    56.                 For cnt = 0 To lstGroups.ListCount - 1
    57.                     If adxGrp.Name = lstGroups.List(cnt) Then
    58.                         lstGroups.Selected(cnt) = True
    59.                     End If
    60.                 Next cnt
    61.             Next
    62. '        End If
    63.     Next
    64.     Set adxGrp = Nothing
    65.     Set adxUsr = Nothing
    66.     Set adxCat = Nothing
    67. End Sub

    any help will be appreciated
    Last edited by phinds; Jul 2nd, 2002 at 01:41 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width