Error message "Error - script is busy"

I have some code in the database Postopen event which verifies the user’s ability to use the database. If the user is not allowed to use this particular replica, the code closes the current database and opens a replica on a different server. The code works fine under 6.5.6, but causes the Notes 8.0.2 client to crash. The error given prior to the crash is Error - script is busy.

This is the part of the code.


’ Need to close current database before opening new database.

Call CurDb.Close

’ Verify new database is available

NewDbOpened = NewDb.OpenByReplicaID (SelectedServer, ReplicaID)

’ If available, then open

If NewDbOpened Then

Call ws.OpenDatabase (NewDb.Server, NewDb.FilePath)

End If


In following the code using the LotusScript debugger, the error is being caused by the Call ws.OpenDatabase command.

Interestingly, commenting out the Call CurDb.Close command prevents the error and client from crashing, but I’m left with both replicas open, which is not what I would like.

Any suggestions?

Thanks,

Scott.

Subject: Use END statement

I had the same problem where in the Client Status bar there was this message: Error - Script is busy.So in my PostOpen there was code where a db.Close() is done and then ws.Urlopen() followed by End Sub.

I added the END statement before End Sub and it works fine now :slight_smile:

Subject: Sorry, I meant Exit Sub instead of End Sub…in above reply

Subject: Place an “Exit Sub” after the call line