Hi… I have the following code in user run agent which creates a number of databases based on a template. The newly created databases when tried to be deleted give the error msg “Database is currently in use by you or another user: filename.nsf”. Filename.nsf is the name of the created database. If I exit and re-enter Notes they can be deleted.
I’m assuming the agent that is creating them is keeping the database open. How I can force the database closed ?
Suggestions?
Dim workspace As New NotesUIWorkspace
Dim template As New NotesDatabase( “”, “template.ntf” )
Dim brandNewDb As NotesDatabase
Dim i as Integer
for i = 1 to 16
Set brandNewDb = template.CreateFromTemplate ( “”, “filename” & i & “.nsf”, True )
brandNewDb.Title = "Title " & i
Call brandNewDb.GrantAccess(“-Default-”, 6)
brandNewDb.DelayUpdates = False
Call workspace.AddDatabase ( “”, “filename” & i & “.nsf” )
Call workspace.ReloadWindow( )
set brandNewDb = nothing
next i
Thanks, James