For MS-SQL 2000, the list of databases is only in the master database.
http://msdn.microsoft.com/en-us/library/aa260406%28v=sql.80%29.aspx
Modifying "sys.databases" to read "master..sysdatabases" worked for me. Here is the resulting script:
use msdb
go
select distinct
d.name
from master..sysdatabases...