I have working LDAP search code for both AD and SunOne (ok, Oracle now). And it all seems to work fine. However, there is a new requirement and I'm scratching my head.
How does one obtain the LDAP return code such as documented on http://msdn.microsoft.com/en-us/library/aa367014(VS.85).aspx ?
A code snippet is attached.
I would think that the LDAP return code is found either in the SearchResultCollection or obtained through exception handling but I'm drawing a blank.
.Filter = String.Concat("(&(objectClass=person)(uid=", thisUid, "))")
Dim queryResults As SearchResultCollection
Dim thisResult As SearchResult
queryResults = dirSearcher.FindAll
_nbrFound = queryResults.Count
For Each thisResult In queryResults
' Obtain values here
Catch ex As Exception
_ErrorText = ex.Message