LOTUSSCRIPT/COM/OLE CLASSES
Sub Initialize On Error Goto processError On Error lsERR_NOTES_DATABASE_NOTOPEN _ Goto processNotOpen Dim dc As NotesDocumentCollection Dim db As New NotesDatabase("", Inputbox("Database?")) Set dc = db.AllDocuments Exit Sub processNotOpen: reply = Messagebox _ ("Database name is wrong", MB_RETRYCANCEL) If reply = IDRETRY Then Call db.Open("", Inputbox("Database?")) Resume Else Messagebox "Error " & Err() & ": " & Error() Exit Sub End If processError: Messagebox "Error " & Err() & ": " & Error() Exit Sub End Sub
Sub Initialize Dim dc As NotesDocumentCollection Dim db As New NotesDatabase("", _ Inputbox("Database?")) Do While Not db.IsOpen reply = Messagebox _ ("Database name is wrong", MB_RETRYCANCEL) If reply = IDRETRY Then Call db.Open("", Inputbox("Database?")) Else Messagebox "Database can't be opened" Exit Sub End If Loop Set dc = db.AllDocuments End Sub
Sub Initialize Dim dc As NotesDocumentCollection Dim db As New NotesDatabase("", "") Do While Not db.Open("", Inputbox("Database?")) reply = Messagebox _ ("Database name is wrong", MB_RETRYCANCEL) If reply <> IDRETRY Then Messagebox "Database can't be opened" Exit Sub End If Loop Set dc = db.AllDocuments End Sub