Solved

LDAP Query by employee id

Posted on 2006-10-26
5
1,046 Views
Last Modified: 2013-12-18
I have a custom app that we are developing that needs to query the domino address book to pull email address information.  I am wanting to set this up to query by employee id first and name second.  The problem i am having is the employee id query can take over 15 seconds to complete while the name query takes about 2 seconds.  Is there any way to improve the performance of the employee id query?  The domino server that i am running the queries on is version 6.5.5
0
Comment
Question by:timkrampe1
  • 2
  • 2
5 Comments
 
LVL 14

Expert Comment

by:p_partha
ID: 17812517
IS employee id the first column in a view, if not consider creating a hidden view, which will replicate across all addressbooks, SOmetimes you do need to customize your names.nsf

Partha
0
 
LVL 63

Expert Comment

by:SysExpert
ID: 17813700
If you are using LDAP queries then this may be slow.

1) make sure that your Address book is indexed.

2) It may be faster to design your own queries using a hidden view as p_partha  suggested.

 
I hope this helps !
0
 
LVL 1

Author Comment

by:timkrampe1
ID: 17814138
The address book is indexed.

Can you explain how to search a hidden view?
0
 
LVL 1

Author Comment

by:timkrampe1
ID: 17814145
I did create a view that has only employee ID, Name, and email address already.  I just don't know how to search it.
0
 
LVL 63

Accepted Solution

by:
SysExpert earned 250 total points
ID: 17814613
Below is sample code, incomplete but a good start.
===================================

Dim sg As NotesSession
Set Sg= New NotesSession
; set Srvnm ad DBnam or hard code as strings

Dim n As Long, Tint As Integer, TNM As Integer, INM As Integer
      Dim col As NotesDocumentCollection
      Dim Nbview As NotesView,  ndb As NotesDatabase  ' ndoc As NotesDocument ' removed v 0.70E
      Dim Message As String, Inet1 As String
      Dim Erl_st  As String,             ERNum_st  As String
 
      
      Set nDb =  Sg .GetDatabase(Srvnm,DBnam ) ' start  on server
      
      If nDb Is Nothing Then
            Message =  "ERROR -- Could Not open DB on  ;" &  Srvnm & " DBname=" & DBnam
            Erl_st ="0"
            ERNum_st = "990"
            Call CreateLogEntry1(Message, Erl_st, ERNum_st )
            Exit Function  ' V 2.0D 11/23
      End If
      
      If Trim(  searchname ) ="" Then
            Message = Ucase("Fatal ERR - Blank Find data ;") & Inetname & "; "  &  Srvnm
            Erl_st ="102"
            ERNum_st = "972"
            Call CreateLogEntry1(Message, Erl_st, ERNum_st )
            Exit  Function  ' 3
      End If
      
      ' Get the values for this person doc from the NAB
      
            Set NBView = nDB.GetView( "($Users)" ) ' Use your viewname here
            Inetname=Lcase$(Inetname)
      
      
      If NBView Is Nothing Then
            Message="ERROR - Could Find view - GetNAB_Doc  ; on :" & Srvnm
            Erl_st ="0"
            ERNum_st = "998"
            Call CreateLogEntry1(Message, Erl_st, ERNum_st )
            Exit Function  ' V 2.0D 11/23
      End If
      
      Set col= NBView.GetAllDocumentsByKey( searchname, False) ' use true if needed
      
' If you cannot find this person, then error message and get out

'      If numdocs > 1 Then   ' removed v 0.70c
      If col.count > 1 Then
      '      Message = Ucase("ERROR -- Multiple Person Docs  Found ;") & UserName & "; " & numdocs & " on " &  Srvnm ' removed v 0.70c
            Message = Ucase("ERROR - Multiple Person Docs  Found ;") & Inetname & "; " &  col.count & " on " &  Srvnm
            Print             Message
            Erl_st ="0"
            ERNum_st = "10"
            Call CreateLogEntry1(Message, Erl_st, ERNum_st )
            
      '      Exit Sub  ' Need to notify of error and skip
      End If
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
This video discusses moving either the default database or any database to a new volume.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now