You can determine whether a database is offline by using sp_helpdb. If this bit is set, it indicates that the database is offline, and therefor, unavailable for general use.
When a database is marked offline by load database, a status bit in the sysdatabases table is set and remains set until the successful completion of online database.
In recovery
DBO use only
Read only
Began upgrade
Bypass recovery
In load
Not recovered
Suspect
Use not recovered
dump database and dump transaction
load database and load transaction
alter database on device
drop database
online database
dbcc diagnostics (subject to dbcc restrictions)