views:

310

answers:

2

I am trying to retrieve data about groups on LDAP. As I need to paginate results, I need to run range queries. My setup uses JNDI to connect to LDAP. I am trying to run this query

 (&(objectclass=group)(range=1-500))

What am I doing wrong? I know there are range based queries for LDAP,how do I modify this query for get the same?

+2  A: 

Well paging is one thing and range is another. You page the results that you get back from the LDAP server when there are more than 1000 entries (at least that's the default in Active Directory).

MSDN has an article on how to do paged searches in .NET; hopefully you can translate that to your environment.

Range is something different. You use range when you have a multi-value-attribute (commonly the member-attribute for a group) that has a large number of values. So you can't have range in the query. You need to specify the range when you access the multi-value-attribute (then instead of just specifying member in the code accessing the property value you specify member;range=1-500 to get the first 500 values from that multivalue attribute).

Per Noalt
I tried using this approach to running range queries but cannot seem to get past the 1000 records limit barrier. Any suggestions there?
Ritesh M Nayak
+1  A: 

Instead of Simple Paging control you may consider using Virtual List View control if your AD is version 2003 or above. Virtual List View provided advanced result sorting options and gives you more power in controlling the subset of the search result set.

Kirill Kovalenko