VB Code:
'Add this code As a reference To the Microsoft SQLDMO Object Library (SQLDMO.DLL).
'NOTE: To use SQLDMO objects you have to have Enterprise Manager
'installed. SQLDMO is the engine that drives Enterprise Manager.
Dim SQLApp As SQLDMO.Application
Dim Names As SQLDMO.NameList
Set SQLApp = New SQLDMO.Application
' get available servers
Set Names = SQLApp.ListAvailableSQLServers
Dim indx As Integer
' add server names to Listbox control
For indx = 1 To Names.Count
List1.Additem Names.Item(indx)
Next
Set Names = Nothing
Set SQLApp = Nothing