[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: LDAP Search Question



This is an LDAP programming FAQ.  The short answer is that the DN is not
an attribute type (although the LDIF file format makes it look like it
is one).  To read an entry given its DN, submit a search request with
scope=base, base=DN, and a filter of (objectclass=*) (where DN is the
actual DN of the entry you want to read).

-- 
Mark Smith
iPlanet Directory Architect / Sun-Netscape Alliance
My words are my own, not my employer's.   Got LDAP?


Tod Thomas wrote:
> 
> I have a potentially stupid question to ask so please bear with me.
> 
> I have a cgi program that searches for individual entries with a given
> search string.  Upon retrieval I would like to list each discovered
> entry as a link pointing to the entry's distinguished name.  Once the
> user selects one of the links the search then proceeds to display
> information about that entry from the dn that was passed to it.  I'm
> having trouble searching with the passed dn, in fact the server just
> spins for a while and then returns nothing.
> 
> My question then is can I do a search against the directory using the
> entry's distinguished name, and if so what API call do I use ?  I think
> it should be no problem so I must be missing some grey matter
> somewhere.  I'm using Netscape Directory server v3.0 with the
> corresponding SDK.  The filter I am using looks like this:   (dn=dn
> returned from previous search).
> 
> Thanks for any help.
> 
> Tod Thomas