Before detaching a database, ensure that there are no active connections to that database and disconnect any that are connected.

For additional information see How to disconnect a user at the server in the Blackbaud Management Console.