Groups > Novell > Novell ActiveX > Antw: Fullname versus SearchBase




Fullname versus SearchBase

Fullname versus SearchBase
Tue, 21 Nov 2006 07:03:04 GMT
Hello,
I don't understand how to tell NWIDirLib.NWIDirCtrl the LDAP-SearchBase.

If I try the code below,
first:
  the call procedure receives an error, because the user:
  cn=admin,o=nsw,ou=ipsec-peers,ou=user,ou=intra,o=nsw
  would not found. (I see it in dstrace)

so i Took an "on error resume next" before the call procedure.
then the call lists all users in the context:
   ou=ipsec-peers,ou=user,ou=intra,o=nsw

But the fields field dosen't work.
Only the "result.Shortname" is in the "entry"
The attribute "FullName" is not in that entry.
------

I only want to set an SearchBase to:
  ou=ipsec-peers,ou=user,ou=intra,o=nsw,
Bind LDAP with user:
  cn=admin,o=nsw  and password,
and then receive many attributes from NDS.

I work with Access2000 VBA.

Is FullName realy the right point to set the SearchBase?


------
Set NWIDir1 = CreateObject("NWIDirLib.NWIDirCtrl.1")
serverName = "LDAP://10.2.1.79"
context = "ou=ipsec-peers,ou=user,ou=intra,o=nsw"
userID = "cn=admin,o=nsw"
Password = "pass"

NWIDir1.FullName = serverName + "/" + context

NWIDir1.LoginName = userID
NWIDir1.Password = Password
NWIDir1.TimeLimit = 120       ' not to be blocked

Call NWIDir1.Connect


NWIDir1.Filter = "(&(objectClass=interOrgPerson)(cn=*))"
NWIDir1.Fields = "FullName"
NWIDir1.SearchScope = 2
NWIDir1.SearchMode = 0
NWIDir1.MaximumResults = 3



Set results = NWIDir1.Entries

For Each result In results

   MsgBox "cn = " & result.Shortname
   FNFields = result.GetFieldValue("FullName")
   MsgBox FNFields
Next

NWIDir1.Disconnect
Set NWIDir1 = Nothing




Network Services Wentz
Ralph Wentz
Neue Unlinger Str. 22
88499 Riedlingen

Tel. 07371/937040
Fax.: 07371/93704-44
Post Reply
Antw: Fullname versus SearchBase
Tue, 21 Nov 2006 15:18:08 GMT
Ok after long reseach i found my error:

FullName is the LDAP-Searchbase!

The Login-Name is correct in that form:
  pEntry.LoginName = "LDAP://10.1.1.1/o=nsw/cn=admin
and Fullname in that Form:
  pEntry.FullName =
"LDAP://10.1.1.1/ou=ipsec-peers,ou=user,ou=intra,o=nsw"

now it works fine...

----
Heres the snip:

  Dim RouterAbschaltung
  Dim results As Variant
  Dim result As Variant

  VLDAPServer = "10.1.1.1"
  VLDAPRouterBase = "ou=ipsec-peers,ou=user,ou=intra,o=nsw"
  VLDAPUser = "o=nsw/cn=admin"
  VLDAPPassword = "pw"

  
  
  Forms.frmHauptmenue.GlobaleVariablenDefinieren

  Set pEntry = CreateObject("NWIDirLib.NWIDirCtrl.1")

  Servername = "LDAP://" & VLDAPServer
  Context = VLDAPRouterBase
  UserId = VLDAPUser 
  Passwd1 = VLDAPPassword

  pEntry.FullName = Servername + "/" + Context
  pEntry.LoginName = Servername & "/" & UserId
  pEntry.Password = Passwd1
  pEntry.TimeLimit = 120       ' not to be blocked

  Call pEntry.Connect

  Const SEARCH_SUBTREE = 2
  Const SEARCH_SYNCHRONOUS = 0

  pEntry.Filter = "(&(objectClass=interOrgPerson)(cn=*))"
  pEntry.Fields = "FullName"
  pEntry.SearchScope = SEARCH_SUBTREE
  pEntry.SearchMode = SEARCH_SYNCHRONOUS
  pEntry.MaximumResults = 0



Set results = pEntry.Entries

For Each result In results

   'MsgBox "cn = " & result.Shortname
   'FNFields1 = result.GetFieldValue("FullName")
   'FNFields2 = result.GetFieldValue("title")
   'MsgBox FNFields1(0)
   'MsgBox FNFields2(0)
Next
  
pEntry.Disconnect
Set pEntry = Nothing


Network Services Wentz
Ralph Wentz
Neue Unlinger Str. 22
88499 Riedlingen

Tel. 07371/937040
Fax.: 07371/93704-44
Post Reply
about | contact