Skip Navigation Links
Home
+
About
+
Products
+
Support
+
Purchase
+
Search
+
ClearSort (Method of LDAPEntryCollection)
Clear the sort criteria.
Syntax
ClearSort
Remarks
Resets the sort order history so that further calls to SortBy do are not affected by previous ones.
Example
Set pLDAP = CreateObject("LDAPClient.3")
Call pLDAP.Connect("ldapserver")

Set pEntries = pLDAP.Search("o=airius.com", "objectClass=Person")

' Sort by sn, then givenName
Call pEntries.SortBy("sn")
Call pEntries.SortBy("givenName")

For Each pEntry In pEntries
    MsgBox pEntry.Attributes("sn").Values(0) + ", " + pEntry.Attributes("givenName").Values(0)
Next

Call pEntries.ClearSort

' Now sort by givenName first and show results again.
Call pEntries.SortBy("givenName")
Call pEntries.SortBy("sn")

For Each pEntry In pEntries
    MsgBox pEntry.Attributes("givenName").Values(0) + " " + pEntry.Attributes("sn").Values(0)
Next