?
Solved

Getting a list of Lotus Notes Servers in VB

Posted on 1999-08-03
9
Medium Priority
?
264 Views
Last Modified: 2013-12-18
Is there a way of getting a list of available Lotus Notes Servers to put into a DropDownCombo ?

This is using VB5 and Lotus Notes 4.6.2a
I am using the Lotus Notes Classes to access the databases, but I would like to present my users with a list of servers to choose from.
0
Comment
Question by:bensewell
[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
  • 6
  • 3
9 Comments
 

Author Comment

by:bensewell
ID: 1120133
Edited text of question.
0
 
LVL 2

Accepted Solution

by:
mchampou earned 150 total points
ID: 1120134
I see that you are using VB to code, no problem. I'll just go over to the various methods you would have if you'd be coding in Notes directly ... then I'll talk about VB.

If you were using @Function, you could use an @DBColumn to get the list of servers from your public address book...

it would look something like this:

@DBColumn("":"NoCache";"MyServer":"names.nsf";"Server\Servers";3)

Keep in mind that I coded the above line without looking at the names and address book to check up on the name of the view and the column number.

In Lotus Script, you could use a NotesDabase, a NotesView and 2 NotesDocument to "run-through" all the documents in the view called Server\Servers in the PAB.

Here we go:

Dim NDB as NotesDatabase
DIM NView as NotesView
Dim NDoc1 as NotesDocument
Dim NDoc2 as NotesDocument


Set NDB = New NotesDatabase ("MyServer", "names.nsf)
Set NView = NDB.GetView("Server\Servers")
Set NDoc1 = NView.GetFirstDocument()
Set NDoc2 = NView.GetNextDocument(NDoc1)

Do Until NDoc1 Is Nothing

    'Ok here you would store the field ServerName from
    'your NDoc1 into another variable (to keep all the
    'server names

    Set NDoc1 = NDoc2
    If (NDoc1 Is Nothing) Then
         Set NDoc2 = GetNextDocument(NDoc1)
    End IF


Loop


Now, from your end, you only have to "recode" the following stuff here here in VB (and don't forget to keep all the server names in a variable!).

Enjoy!

mchampou
0
 

Author Comment

by:bensewell
ID: 1120135
This almost works. However, I have found that the server lists are in fact stored under "Groups", in two documents; "LocalDomainServers" and "OtherDomainServers".

Is this a mistake, or is this okay?
0
Industry Leaders: 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!

 
LVL 2

Expert Comment

by:mchampou
ID: 1120136
The LocalDomainServers group will do the job too ... here is the lotusscript code to do the job :

Dim NDB as NotesDatabase
DIM NView as NotesView
Dim NDoc1 as NotesDocument


Set NDB = New NotesDatabase ("MyServer", "names.nsf)
Set NView = NDB.GetView("Groups")
Set NDoc1 = NView.GetDocumentByKey("LocalDomainServers",True)

If (NDoc1 Is Nothing) Then
   Print "Unable to find group LocalDomainServers"
   Exit Sub
End If

'OtherWise you can now access the list of servers because it is stored in the item "Members".

0
 

Author Comment

by:bensewell
ID: 1120137
Thanks, mchampou.

However, there is now another problem. Using this code, Notes seems reluctant to open names.nsf. The database is assigned using the Set statement, but when the one after that is run, error 7063 - "Database names.nsf has not been opened yet" occurs. I have tried using delaying loops in the error handling routine, and then resuming the code, but this sends it round in a loop, never seeming to open names.nsf. Any ideas?
0
 
LVL 2

Expert Comment

by:mchampou
ID: 1120138
Yikes, no I don't have many ideas regarding this problem =(

Perhaps, you might want to do a "while" loop to check up on the IsOpen property of the database object ... IsOpen turns to "True" when it's opened otherwise it's False

But I don't think it has to do with your code (then again, I'm not sure)

Then again again, what is the next statement you are trying to do ? Could you please post the 2 lines in here ? Thanks!

Another solution would be to post another question as I can't figure out what could be the cause of your trouble right away, perhaps another expert will be able to assist you better than I.
0
 

Author Comment

by:bensewell
ID: 1120139
mchampou,

I deleted the other question you were working on for me because I figured the problem out myself:

With cur_doc
Do
  Set cur_doc = DBRes.CREATEDOCUMENT
   'change fields here
  cur_doc.save true, false
loop
end with

This does not save each doc individually becasue the With statement is before the CREATEDOCUMENT!

0
 

Author Comment

by:bensewell
ID: 1120140
The next two lines of code are:

Set NView = NDB.GETVIEW("Groups")
Set NDoc1 = NView.GETDOCUMENTBYKEY("LocalDomainServers, True)

0
 

Author Comment

by:bensewell
ID: 1120141
Posted another question ...
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

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

718 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