[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-ldap-dev
Subject:    Re: Is there a direct way to return attributes from an entry w/o	search?
From:       Chris Ridd <chrisridd () mac ! com>
Date:       2003-08-06 16:40:15
[Download RAW message or body]

On 6/8/03 4:55 pm, markinpa <mark_leddy@hotmail.com> wrote:

> 
> I know how to Access Individual attributes from a Returned Query
> http://www.sbfsbo.com/mike/NetldapTutorial/ I understand this does a ldap
> search,
> 
> In my case, I know the DN of the entry I know the DN of the entry I want to
> return the attributes of, can someone tell me how to do this without
> performing a search?

You *have* to do a search, as that's the only operation LDAP has which
returns entries to you.

However in your case you can just a base object search, with the base set to
the DN you know. Use a filter that is guaranteed to match (since entries
must have object classes, objectClass=* will match).

This is the correct way to "read" a single entry using LDAP:

$res = $ldap->search ( base => $mydn,
                       scope => 'base',
                       filter => '(objectClass=*)' );
my $entry = $res->entry(0);

Add error checking to suit :-)

> I am very thankful for any help.
> 
> Thanks,
> Mark
> 
> 
> 

Cheers,

Chris

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic