Handling of this ADSVALUE type is not yet implemented (type = 0xb)
From: Cameron Eckman (ceckman_at_baxglobal.com)
Date: 05/27/04
- Next message: DaveInRedmond: "Re: Migrate from fox pro"
- Previous message: DJA: "Migrate from fox pro"
- Next in thread: Cameron Eckman: "Re: Handling of this ADSVALUE type is not yet implemented (type = 0xb)"
- Reply: Cameron Eckman: "Re: Handling of this ADSVALUE type is not yet implemented (type = 0xb)"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 27 May 2004 15:52:05 -0700
I am recieving the for only the same property every time when searching
against a Lotus Notes LDAP. A previous version of C++ code (VS6) finds this
attribute {ppszValue = ldap_get_values(ldapConn, ldapmsgResult,
"statcode");} without problem. I am writing a .NET version and running into
this error only for the one field out of the seven I am trying to receive.
I followed the
http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=153151 thread and
tried a few things I saw different in there with the same result.
I asked the following (reponses next to it) to our Notes administrator:
When the LDAP item is defined are there different types? - No
What is the statcode type? - There are no different "types"
What is the givenname type? - There are no different "types"
Can the statcode type be changed to be the same as the givenname type
without a lot of work & causing problems with other applications that access
it? - It already is the same, there are not different "types" of fields in
Domino LDAP.
As I am not an LDAP expert is there something else I can ask/communicate to
the Notes adminstrator to help solve this issue.
Code below (use a VB.NET console app to test):
Public Sub Main()
Dim oNotes As New LotusNotes()
Dim oUsers As New Users()
Dim oUser As User
oUsers = oNotes.Search("C*", "E*")
For Each oUser In oUsers
Console.WriteLine("Name: {1}, {0} {2}", oUser.FirstName,
oUser.LastName, oUser.Email)
Console.WriteLine(" '{0}' {1} {2} {3}", oUser.Station,
oUser.City, oUser.State, oUser.Country)
Next
End Sub
Public Class LotusNotes
Public Function Search(ByVal FirstName As String, ByVal LastName As String)
As Users
Dim sLdapRoot As String
Dim sFilter As String
Dim sbLdapFilter As New StringBuilder("")
Dim deRoot As DirectoryEntry
Dim dsMail As DirectorySearcher
Dim srMails As SearchResultCollection
Dim oUsers As New Users
Try
sLdapRoot = "LDAP://BaxLdapServer/o=BAX"
sbLdapFilter.Append("(&(givenname=")
sbLdapFilter.Append(FirstName)
sbLdapFilter.Append(")")
sbLdapFilter.Append("(surname=")
sbLdapFilter.Append(LastName)
sbLdapFilter.Append("))")
deRoot = New DirectoryEntry(sLdapRoot)
dsMail = New DirectorySearcher(deRoot, sbLdapFilter.ToString())
With dsMail
.PropertiesToLoad.Add("givenname") ' FirstName
.PropertiesToLoad.Add("sn") ' LastName
.PropertiesToLoad.Add("mail") ' Email
.PropertiesToLoad.Add("statcode") ' Station
.PropertiesToLoad.Add("st") ' State
.PropertiesToLoad.Add("l") ' City
.PropertiesToLoad.Add("c") ' Country
srMails = .FindAll()
End With
oUsers = New Users()
oUsers.SortBy = SortBy
oUsers.FromSearch(srMails)
Return(oUsers)
Catch ex As Exception
Throw(ex)
Finally
If (Not srMails Is Nothing) Then srMails.Dispose()
If (Not dsMail Is Nothing) Then dsMail.Dispose()
If (Not deRoot Is Nothing) Then deRoot.Dispose()
End Try
End Function
End Class
Public Class Users
Inherits CollectionBase
Default Public ReadOnly Property Item(ByVal Index As Integer) As User
Get
Return(CType(List(Index), User))
End Get
End Property
Friend Sub FromSearch(ByVal SearchResults As SearchResultCollection)
Dim srLoop As SearchResult
Dim oUser As User
For Each srLoop In SearchResults
oUser = New User()
oUser.SetFromLdap(srLoop.Properties)
List.Add(oUser)
Next
End Sub
End Class
Public Class User
Private msFirstName As String
Private msLastName As String
Private msStation As String
Private msEmail As String
Private msCity As String
Private msState As String
Private msCountry As String
Friend Sub SetFromLdap(ByVal Properties As ResultPropertyCollection)
msFirstName = FromResult(Properties.Item("givenname"))
msLastName = FromResult(Properties.Item("sn"))
msEmail = FromResult(Properties.Item("mail"))
msStation = FromResult(Properties.Item("statcode")) ' Fails here every time
!!!!
msState = FromResult(Properties.Item("st"))
msCity = FromResult(Properties.Item("l"))
msCountry = FromResult(Properties.Item("c"))
End Sub
Private Function FromResult(ByVal Values As ResultPropertyValueCollection)
As String
Dim oValue As String
Dim sValue As String
Dim sReturn As String = ""
Try
If (Not Values Is Nothing) AndAlso (Values.Count > 0) Then
For Each sValue In Values
sReturn += sValue
Next
End If
Return(sReturn)
Catch ex As Exception
If (ex.Message.IndexOf("NotImplementedException") > -1) Then
' For some reason certain properties throw the following:
' Handling of this ADSVALUE type is not yet implemented (type = 0xb).
Return("")
Else
Throw(ex)
End If
Finally
End Try
End Function
End Class
- Next message: DaveInRedmond: "Re: Migrate from fox pro"
- Previous message: DJA: "Migrate from fox pro"
- Next in thread: Cameron Eckman: "Re: Handling of this ADSVALUE type is not yet implemented (type = 0xb)"
- Reply: Cameron Eckman: "Re: Handling of this ADSVALUE type is not yet implemented (type = 0xb)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|