Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Levin, Manawatu-Wanganui, New Zealand
    Posts
    324
    Thanks
    9
    Thanked 28 Times in 26 Posts

    querying ACtive Directory Win 03

    Good evening loungers

    Could someone please point in the correct direction to get to the starters box.

    I wish to use vba to access user details in the AD.

    The goal is to automatically populate docvariables in some Word templates.
    Currently I use an access database but it is redundant if I can hit the AD.

    Server 2003, Office 03

    Regards
    Geof

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: querying ACtive Directory Win 03

    I think we've had a couple threads on this. Here's an article I ran across in the past 10 minutes on using ADO: Searching the AD.

  3. #3
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Levin, Manawatu-Wanganui, New Zealand
    Posts
    324
    Thanks
    9
    Thanked 28 Times in 26 Posts

    Re: querying ACtive Directory Win 03

    Hi Jefferson
    I am off to a rasonable start with this.

    The following works fine ..
    objCommand.CommandText = "SELECT AdsPath,cn FROM 'LDAP://DC = ara,DC=local' WHERE Name = 'geof richardson'"

    I now want to pass the the contents of a text box through to that select statement
    something like userform1.tbName.

    I am getting all the problems associated with the quoting ...

    Any help would be appreciated

    Regards
    Geof

  4. #4
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Levin, Manawatu-Wanganui, New Zealand
    Posts
    324
    Thanks
    9
    Thanked 28 Times in 26 Posts

    Re: querying ACtive Directory Win 03

    Hi folks

    I got it

    objCommand.CommandText = "SELECT AdsPath,cn FROM 'LDAP://DC = ara,DC=local' WHERE Name = ' " & strName & "'"

    cheers
    Geof

Posting Permissions

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