authentication problem with LDAP query (I think)



Basically, I have an aspx page generating the same query as an asp page.
The asp (classic) version works fine, but the ASP.NET (vb) one gives me an
error 80005000, no matter how I try it.

On Error Resume Next
Dim oRoot As DirectoryEntry = New DirectoryEntry(sql)
If Err.Number <> 0 Then Trace.Write("139 " & Err.Description)
oRoot.Username = "xxx\xxxxxx"
If Err.Number <> 0 Then Trace.Write("142 " & Err.Description)
oRoot.Password = "xxxxxxxx"
If Err.Number <> 0 Then Trace.Write("144 " & Err.Description)
'On Error Resume Next
oRoot.AuthenticationType = AuthenticationTypes.Secure
If Err.Number <> 0 Then Trace.Write("146 " & Err.Description)
Dim oSearcher As DirectorySearcher = New DirectorySearcher(oRoot)
If Err.Number <> 0 Then Trace.Write("147 " & Err.Description)

Dim oResults As SearchResultCollection
If Err.Number <> 0 Then Trace.Write("151 " & Err.Description)
Dim oResult As SearchResult
'Dim RetArray As New Hashtable()
' Try

' On Error Resume Next
oResults = oSearcher.FindAll
If Err.Number <> 0 Then Trace.Write("160 " & Err.Description)

the error comes in the last line. I have added the .username, .password and
AuthenticationTypes.Secure lines with no improvement.


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question