Advertisement

02.22.2008 at 07:52PM PST, ID: 23186562
[x]
Attachment Details

LDAP Query with ADODB returns error on querying custom attributes

Asked by dcordner in Lightweight Directory Access Protocol (LDAP), Miscellaneous Programming, VB Script

Tags: LDAP, NA, NA

Hello,
I am quering the LDAP directory of IBM Tivoli, and am using the following VBSCRIPT. The script below works fine. However, when I add one of our custom attributes to the query ...

Replacing:   "(&(objectclass=*)(uid=cordnerd));cn,uid;subtree"
With:    "(&(objectclass=*)(uid=cordnerd));cn,uid,tutuid;subtree"
I get the following error.
---------------------------
Windows Script Host
---------------------------
Script:      I:\VBS\GetLDAPData.VBS
Line:      26
Char:      5
Error:      Unspecified error
Code:      80004005
Source:       Provider

---------------------------
OK  
---------------------------

Here's the whole script that works.
    Dim conn
    Dim com
    Dim oRecordset
    Dim sTmp
    Dim ReturnValue

    '*******************************
    '  Open the connection to LDAP  
    '*******************************

    Set conn = CreateObject("ADODB.Connection")
    conn.Provider = "ADsDSOObject"
    conn.Properties("User ID") = "cn=TheMan"
    conn.Properties("Password") = "thepassword"
    Dim strCN
    'conn.Open "LDAP Provider"
    conn.Open "ADs Provider"


    Set com = CreateObject("ADODB.Command")
    Set com.ActiveConnection = conn
    com.CommandText = "<LDAP://idprod4.ocis.temple.edu:1389/ou=0,ou=people," & _
    "erglobalid=00000000000000000000,ou=Temple,dc=edu>;" & _
   "(&(objectclass=*)(uid=cordnerd));cn,uid;subtree"
    com.Properties("Page Size") = 100000
    com.Properties("Timeout") = 60

    Set oRecordset = com.Execute
    wscript.echo oRecordset.recordcount
   
    Do While Not oRecordSet.EOF
            sTmp=""
        For i = 0 To oRecordSet.Fields.Count-1
       
                  ReturnValue = oRecordSet.Fields(i)
                  If IsArray(ReturnValue) Then
                        For j = LBound(ReturnValue) To UBound(ReturnValue)      
                             If ReturnValue(j) <> "" Then
                                    sTmp=sTmp & "," & ReturnValue(j)
                              End If
                        Next
                 
                  Else
                  End If

        Next
        wscript.echo sTmp
        oRecordSet.MoveNext
    Loop



Any help would be GREATLY appreciated.

--

DonStart Free Trial
[+][-]02.22.2008 at 08:17PM PST, ID: 20963628

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]02.22.2008 at 11:05PM PST, ID: 20963977

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.23.2008 at 03:14AM PST, ID: 20964534

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.22.2008 at 03:02PM PDT, ID: 21415987

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Lightweight Directory Access Protocol (LDAP), Miscellaneous Programming, VB Script
Tags: LDAP, NA, NA
Sign Up Now!
Solution Provided By: dcordner
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628