• Determine Security Group of CurrentUser with ADO (Access 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Determine Security Group of CurrentUser with ADO (Access 2000)

    Author
    Topic
    #417492

    I’m trying to control the locked property of a subform based on what security group the current user is a member of. I’m using ADO, not DAO, in this app, and I also have a reference set to the ADO Ext. 2.8 for DDL and Security. This is the first time I’ve ever used this set of objects, and I’m having trouble figuring out how to do this.

    It seems like I should be able to iterate through the users of a specific group. And if CurrentUser matches one of the members, I can set the locked property of the subform.
    Sounds good in theory – but can I do this?!!! confused3

    I know I can always hard code user names and compare CurrentUser directly, but I really don’t want to do it that way.

    Has anyone successfully accessed security objects via code? Any help would be greatly appreciated!!!

    Thanks!!

    Viewing 0 reply threads
    Author
    Replies
    • #936851

      I know that you want to use ADO, but Microsoft explicitly recommends using DAO for this kind of thing rather than ADOX – see Access Security FAQ; this paper contains sample code to list the users of a group and to determine whether a user is a member of a specific group (section 22).

      • #936852

        Thanks, Hans. As usual you’ve given me the direction to go in. I’ll check out the code samples!!

        Appreciate it!!
        Mike

    Viewing 0 reply threads
    Reply To: Determine Security Group of CurrentUser with ADO (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: