ListAvailableSQLServers produces unpredictable results

ListAvailableSQLServers produces unpredictable results when I use SQLDMO with VB6. For a long time it produced a list of all available SQL servers in addition to their respective instances (e.g. SERVER1\InstanceA, SERVER1\ InstanceB, SERVER2\InstanceA). Then, a few months ago the servers appeared without the instances (e.g. SERVER1, SERVER2). Recently, after another server was added to the network, the result set started showing instances again (as in the first example). The worst thing is unpredictable results. Help!

Cnt = oApplication.ListAvailableSQLServers.Count

Set SSSList = oApplication.ListAvailableSQLServers

Dim i As Integer
Dim j As Integer

For i = 1 To Cnt
DoEvents
StrNAm = SSSList.Item(i)
Set InstanceList = SQLServer.ListInstalledInstances(StrNAm)
If Not InstanceList Is Nothing Then
For j = 1 To InstanceList.Count
' Debug.Print InstanceList.Item(j)
cboSQLServers.AddItem InstanceList.Item(j)
Next
End If
Next

P.S. I only started including the ListInstalledInstances method when the server names showed up w/o their respective instances. I heard this will be deprecated, but what other choice do I have? (I don't have .NET)

[1250 byte] By [romrom] at [2008-1-4]

SQL Server

Site Classified