Close db A from db B with script

Hi,

Ik found topics on closing database with script, but only to close the current database. Is there a way to close another db?

Ken