I searched the internet and found the following code:
It just gives the list of some sql 2000 servers and my local sql server 2008 instance. But when I use the microsoft ado data control's properties and select database, I find that there are many more servers than the ones in the above code. Why I am not able to get all these using the above code?
Code:
Dim ss As SQLDMO.Application
Dim nm As NameList
Set ss = SQLDMO.Application
Set nm = ss.ListAvailableSQLServers
For lc = 1 To nm.Count
cmbDBs.AddItem nm.Item(lc)
Next