There is a requirement for me to analyze all the databases in the given server. So I got all the database names and trying to get the handle of each database whereas I am having only the server name and the database path.
In this situation I cant process the databases which I don't have access. So I want to check the access of the database for the current user. If you wan to check the ACL of the user for the current database, you want to get the database handle. But you can't use the db.getDatabase("databasename"). Because this itself throughs the error while trying to get the handle of the database.
Then I thought to check whether I have the access to the given database or not(Only Boolean - True/False). The following code snippet will do that in simple way.
Function CheckDBAccess(checkDBServer As String, checkDBPathStr As String) As Boolean
On Error GoTo errorHandler
Dim checkDB As NotesDatabase
Dim ses As New NotesSession
Set checkDB = ses.Getdatabase(checkDBServer, checkDBPathStr, False)
CheckDBAccess = True
Exit Function
errorHandler:
CheckDBAccess = False
Exit Function
End Function
Now, Just I want to call this function for each database passing the database name. I t will return the access of the database.
I hope this will help you a lot and save your time.
No comments:
Post a Comment