'Add this code As a reference To the Microsoft SQLDMO Object
'Library (SQLDMO.DLL). 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 ' print names to debug window For indx = 1 To Names.Count Debug.Print Names.Item(indx) Next Set Names = Nothing Set SQLApp = Nothing This tip was submitted by Kristjan Kelt. |