I have an agent that I need to run from the web. It needs to make copies of databases and then add some documents. This works when I run from client, but on the web the databases are not being created.
The script seems to think the databases are being created: my function returns valid (?) NotesDatabase objects with Replica IDs. There are no script or server console errors but the databases are not anywhere on the server. Here’s my code:
Public Function CopyDatabase(ServerName As String, SourceDBPath As String, TargetPath As String) As NotesDatabase
On Error Goto ErrHandler
Dim dbToCopy As NotesDatabase
Set dbToCopy = GetExternalDatabaseByFilePath(SourceDBPath,ServerName)
If Not dbToCopy Is Nothing Then
Dim newDB As New NotesDatabase("","")
Set newDB = dbToCopy.CreateCopy(ServerName,TargetPath)
newDB.Title = dbToCopy.Title
Set CopyDatabase = newDB
End If
Exit Function
ErrHandler:
Set CopyDatabase = Nothing
Exit Function
End Function
Having never done this … Random thoughts when I read this
(1) The person who signed the agent running, do they have unrestricted rights to create a database and effectively create a database on the server?
(2) You said you are getting a database, is it possible it’s only in “memory” and you need to save something to the harddrive. I don’t see a DB.save method.
(3) Even if you wrote the DB out, how would you access it? Not ACL seems to be setup. I guess you would get the default. But first you’d have to see a db which you’re not, so that goes back to point 2.