views:

222

answers:

2

I would like to list what instances of SQL 2005 Server (Express Editon) are installed on local or remote machine (my app is in Native C++). I found that i can make it by SQLDMO, however it seems that SQLDMO does not see SQL 2005 Express Edition and call to ListAvailableSqlServers returns empty list.

How can i make it? Playing with system registry is an extreme solution and applies only for local machines.

A: 

You can try SqlDataSourceEnumerator.GetDataSources(). Works well in C# and VB.Net though I haven't tried it from C++.

Jeremy
Thanks. I checked that method but it is available since .NET 2.0 and this version of framework is unreachable to me. I work with VS2003.
+1  A: 

Got it... Found SQLBrowseConnect. Answer is as usual in MSDN :-)

Marcin