Getting IFO about MSSQL 2000

Hiya

Im trying to make a small program that given a machine name, on a local
network, will return me information about MSSQL 2000 is running on that
machine. If running, it also returns information about which databases are
available

How do you do that ? Any link or info would be appreciated

-Eyvind