Solved

LDAP Query by employee id

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

688 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