You have a dead file for a database that was active. For example, you have lost a disk drive or if you have lost file MDF file. Now you try to detach it from the SQL Server Management Studio, it won't let you do it.
Try manually firing the query then
The key above is that you are going to the master and not any other databases.