Select a Server / Database Code Sample

Mindwatering Incorporated

Author: Tripp W Black

Created: 07/30/2005 at 03:18 PM

 

Category:
Notes Developer Tips
LotusScript

The following code sample allows a user to select and return a database.

Function UserDbSelect(w As NotesUIWorkspace) As Variant
' this function returns a variant array containing three values
' (0) = server (returns "" for local)
' (1) = database w/path
' (2) = database title
Dim dbchosen As Variant ' selecting a database returns a 3 value array

' the title and body part of the prompt is ignored for type 13 searches
' dbchosen = w.Prompt(13, "Select Database", |Please select a server and a database. When done press the "Open" button|, "")
dbchosen = w.Prompt(13, "", "")

' check if user selected nothing and pressed cancel
If (Isarray(dbchosen) ) Then
' user selected a server & database
UserDbSelect=dbchosen
Exit Function
Else
' user pressed cancel
Print 'nothing selected'
' return nothing
UserDbSelect=""
Exit Function
End If

End Function

previous page