Solved

LDAP Query by employee id

Posted on 2006-10-26
5
1,100 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Compose new document with values from selected doc using LotusScript 36 314
Lotus Domino Server Failure 1 198
Lotus notes error message 6 110
Add a cc field to email code 6 102
For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
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
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 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