Check to see if server is available

dumb question probably…but I am connecting to another notes server to get column values for a picklist…i need to check & see if the server is available, if not, i can have it point to another server for the values…

thanks

Subject: Check to see if server is available

use @DbExists to check if the db is available. If you can get to the db then the server is up. You can also use @IsError to check if the lookup errors out and then try the other server.

Subject: Check to see if server is available

Since you didn’t specify the environ that you need to work within, here is a LS method. You can also go further, and check for a specific database by using the open method (see the Help for more info).

Sub Click(Source As Button)

On Error Goto displayerror



Dim session As New NotesSession

Dim directory As NotesDbDirectory

Dim db As NotesDatabase

Set directory = session.GetDbDirectory( "dsys" )



Msgbox "the server " + directory.Name + " exists."



Exit Sub

displayerror:

'Do all of your error handling here.

Msgbox Cstr(Erl) + Chr$(10) + Error$

Exit Sub

End Sub

If I place an invalid string as the server name, I get an error, which should also capture the server name if the server is down or cannot be contacted. I don’t currently have a valid server in the Domino Directory that is offline, so I can’t test it that far, but it should work properly.