Solved

LDAP Query by employee id

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

770 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