Solved

LDAP Query by employee id

Posted on 2006-10-26
5
1,059 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Lotus Notes - Broken Links report 5 203
Lotus Notes - Open specific view in frameset (right side) 2 228
Lotus notes VB code 4 206
LotusScript: Merge Data to Word File 22 81
This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 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

23 Experts available now in Live!

Get 1:1 Help Now