Problem using SQLDMO to get list of available SQL servers

  • Thread starter Thread starter Zack Sessions
  • Start date Start date
Z

Zack Sessions

I am using VB.NET 2003.

I found the following sample code here in an article:

Dim oSQLServerDMOApp As New SQLDMO.Application
Dim i As Integer
Dim namX As SQLDMO.NameList

namX = oSQLServerDMOApp.ListAvailableSQLServers
For i = 1 To namX.Count
cbSQLServer.Items.Add(namX.Item(i))
Next

When I try to use it, I get the runtime error:

QueryInterface for interface SQLDMO.NameList failed.

I cannot find this error documented anywhere. Can anyone help?
 
Hi,

Dim sqlServers As SQLDMO.NameList

Dim sqlServer As String

' Get a list of servers

sqlServers = New SQLDMO.Application().ListAvailableSQLServers

For Each sqlServer In sqlServers

ComboBox1.Items.Add(sqlServer)

Next



Ken

------------------------------

I am using VB.NET 2003.

I found the following sample code here in an article:

Dim oSQLServerDMOApp As New SQLDMO.Application
Dim i As Integer
Dim namX As SQLDMO.NameList

namX = oSQLServerDMOApp.ListAvailableSQLServers
For i = 1 To namX.Count
cbSQLServer.Items.Add(namX.Item(i))
Next

When I try to use it, I get the runtime error:

QueryInterface for interface SQLDMO.NameList failed.

I cannot find this error documented anywhere. Can anyone help?
 
Install SQL Server 2000 SP3.
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing
 
Back
Top