Hi,
i want to know whether the database is exist in particular server or not using lotus script , i know using dbdirectory we can handle all the databases in the specified server, but i dont want to do like that, because here i have to check 100 databases which are in 100 different servers please let me know this is very urgent requirement for me.
Subject: how to find database is exist or not
Hi,
Search the forum for : notesdatabase and isopen and notessession
or Designer help
This script attempts to open TODO.NSF on the server Bombay. If the database is found, it is opened, and IsOpen returns True. If the database is not found (for example, because it doesn’t exist), IsOpen returns False.
Dim db As New NotesDatabase( “Bombay”, “todo.nsf” )
If db.IsOpen Then
Print( "Succesfully opened " & db.Title )
Else
Print( “Unable to open database” )
End If
Then, just use a loop with your list of databases to check.
JYR
Subject: RE: how to find database is exist or not
Does this only opens the db in the background or it opens it in the client?
Subject: RE: how to find database is exist or not
Both. If you take for example the DST agents from IBM.
Function InitializeMailfile ( strMailFileServer As String, strMailfileName As String, dbRootMemo As Notesdocument, body As String) As Boolean
'Declare pdocroot globally - need to keep our handle to it to ensure avoid memory leak that occurs when re-access profile 1k's of times
On Error 4060 Goto Error4060 'Means ACL is set to No Access for agent signer/executor
' setup DB handle for the rest of the code
Set db = New NotesDatabase(strMailFileServer, strMailfileName)
If Not(db.Isopen) Then
Print "Unable to process: " + strMailfileName
LogMessage "Unable to process: " + strMailfileName + Chr(10) + Chr(10)
Call dbRootMemo.Save(True, False, True)
InitializeMailfile=False
Exit Function
End If
If db.currentaccesslevel<4 Then
Print "Unable to process: " + strMailfileName + " ACL access is lower than Editor."
LogMessage "Unable to process: " + strMailfileName + " ACL access is lower than Editor" + Chr(10) + Chr(10)
Call dbRootMemo.Save(True, False, True)
InitializeMailfile=False
Exit Function
End If
Dim cdoc As notesdocument
Dim profilecollection As NotesDocumentCollection
If pdocroot Is Nothing Then
Set pdocroot=dbroot.GetProfileDocument("CalendarProfile")
End If
Set profilecollection=db.GetProfileDocCollection("CalendarProfile")
If profilecollection.Count>0 Then
Set cdoc=profilecollection.getfirstdocument
If cdoc.hasitem("Owner") Then
Call pdocroot.replaceitemvalue("Owner", cdoc.getitemvalue("Owner")(0))
End If
Else
Set profilecollection=db.GetProfileDocCollection("iNotesProfile")
If profilecollection.Count>0 Then
Set cdoc=profilecollection.getfirstdocument
If cdoc.hasitem("Owner") Then
Call pdocroot.replaceitemvalue("Owner", cdoc.getitemvalue("Owner")(0))
End If
Else
Call pdocroot.replaceitemvalue("Owner", cdoc.getitemvalue("Owner")(0))
End If
End If
' setup view handle
Set vwCalendarView = db.GetView("Calendar")
If vwCalendarView Is Nothing Then
Print "Unable to process: " + strMailfileName + ". Calendar view is not present."
LogMessage "Unable to process: " + strMailfileName + ". Calendar view is not present." + Chr(10) + Chr(10)
Call dbRootMemo.Save(True, False, True)
InitializeMailfile=False
Exit Function
End If
InitializeMailfile=True
ResumeHere:
Exit Function
error4060: 'No ACL access
Print "Unable to process: " + strMailfileName + " Your ACL rights were No Access."
LogMessage "Unable to process: " + strMailfileName + " Your ACL rights were No Access." + Chr(10) + Chr(10)
Call dbRootMemo.Save(True, False, True)
InitializeMailfile=False
Resume ResumeHere
End Function