Results 1 to 6 of 6
  1. #1

    LDAP and QTP via ADODB

    I am currently working on a project that involves using an ADODB connection to connect to and query an LDAP server. Does anyone have any tips on how to make a basic connection and high level query to validate that the connection is working. At this point all I get is a "Table does not exist error" with the connection information I have.

    I have the
    LDAP Server name and port
    Server type = Sun

    I am not trying to do anything more at this point than verify that the connection is valid. Any help would be appreciated.


  2. #2

    Re: LDAP and QTP via ADODB

    So maybe the following will help to get a response from someone who knows more about this than I.

    I found this bit of code to connect to an LDAP server on a QTP related blog. I have changed it and added my correct information but am still receiving the "Table not found error" From looking around the interweeb it seems like something is not right in the connection are of the SQL statement.
    If there is any other information that is needed I will do my best to track it down. At this point I am stumped.

    One thing I was not sure of is the how the name of the LDAP server should be entered.
    I have the server name and port number.

    abc17:2233 for example

    does the the server need to be the actual IP address or do i need more information like the full path of the server?

    Dim UserName
    UserName = "jsmith"
    Call getDNofUser(UserName)

    public Function getDNofUser(UserName)
    Set con = CreateObject("adodb.connection")
    con.Open "Provider=ADsDSOObject;", "cn=qtpuser", "qtpuser"
    sql = "select cn from 'LDAP://xxxx:xxxx/dc=xyzcorp,dc=com;subtree' where ObjectClass='inetorgperson'and uid='"& UserName & "'"

    Set rs = con.Execute(sql)

    Do until rs.EOF
    ReturnValue = rs.Fields(0)
    If IsArray(ReturnValue) Then
    val = "cn=" & ReturnValue(0) & ",cn=people,dc=xyzcorp,dc=com"
    Val = "cn=" & ReturnValue & ",cn=people,dc=xyzcorp,dc=com"
    End If
    getDNofUser = val
    End Function

    I appreciate an help you all could provide.


  3. #3

    Re: LDAP and QTP via ADODB


    I haven't explored this, but a quick search on google points to wrong LDAP path. Can you try the article below.


  4. #4
    Join Date
    Sep 2001
    Doncaster, UK

    Re: LDAP and QTP via ADODB

    Mack, a few years ago I wrote a VBScript routine to load users to LDAP. I ran the routine from the physical Wintel box that hosted LDAP not via an ActiveX Data Object call.

    I think I still have the routine on a memory stick or DVD somewhere, would it be of any use to you?

    Mark Smith.

  5. #5

    Re: LDAP and QTP via ADODB


    I don't think it would help due to the nature of the client I am working with I would not have access to the physical box. All of our work is being done via VPN and Citrix so I don't have many options regarding this. Worst part is all I need is one field from LDAP so I can automate the activation of new users.

    Thanks for the offer though. I will continue searching and learning more about ADO connections and LDAP.


  6. #6

    Re: LDAP and QTP via ADODB


    Hey thanks for the link. I have been wearing google out but never saw that page. It looks like some good information and may get me one step closer to a solution.

    Right now I am trying to get TOAD setup so I can write a query that I know works and then test that. As I noted above I am working remotely via Citrix and the only tool provided to look at the LDAP server currently is JXplorer which is purely graphical. I sure never thought that this would be as complicated as it has been but such is life.

    Thanks again for your input,




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 07:38 PM.

Copyright BetaSoft Inc.