It is probably a matter of figuring out what client code is being run that causes the error and either fixing the code or educating the user (if it is ad-hoc code). There are various system functions, such as object_name(object_id [,dbid]) that will generate this error if passed dbid 0.
(Some other functions treat dbid 0 as "current database").
-bret