Analysis Services is totally separate from MSSQL, so you can't use TSQL
to query it directly. Even if you create a linked server from MSSQL, it
is linked to a single AS database, not to the AS server as a whole. But
there are (at least) a couple of ways to enumerate the databases and
cubes.
First, if you've migrated the metadata repository to an MSSQL database,
then you can use queries like this:
select count(*) from OlapObjects
where objectdefinition like '<database%'
select count(*) from OlapObjects
where objectdefinition like '<cube%'
If you haven't migrated the repository, you may be able to use an
equivalent query in Access to get the information, but I've never tried
that myself.
Second, you can use the DSO COM interface to enumerate the MDStore
objects. See "Decision Support Objects Architecture" in Books Online
for more details. This is probably a better solution, because the
repository database isn't documented (as far as I know), and DSO is the
standard mechanism for managing AS from code.
If this doesn't help, you could try posting in
microsoft.public.sqlserver.olap.
Simon