I have a scheduled agent that uses the NotesDbDirectory class. It cycles through a list of servers, then through each database on the server.
Here is my code snippet:
Dim dbDir As NotesDbDirectory
…
Forall servers In serverList
serverName = servers
Set dbDir = New NotesDbDirectory(serverName)
'Let's start to run through all DBs on the Server...
Set dbCheck = dbDir.GetFirstDatabase(DATABASE)
While Not(dbCheck Is Nothing)
…
Set dbCheck = dbDir.GetNextDatabase
Wend
End Forall
I am receiving this error, Error (4197): Must call GetFirstDbFile before GetNextDbFile, in the server log, when it hits:
Set dbCheck = dbDir.GetNextDatabase
I found this post, but it did not help:
It seems that the ID that signed the agent does not have access to the server, so it is throwing this error.
Should I trap this error and perform a Resume Next? Or do I have to reset the NotesDbDirectory object?
Thanks!
Dan