When a single database is specified, membership in the public role in the database is required. When no database is specified, membership in the public role in the master database is required.
If a database cannot be accessed, sp_helpdb displays error message 15622 and as much information about the database as it can.