473,320 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Problem using SQLDMO to get list of available SQL servers

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?
Nov 21 '05 #1
3 7003
Try installing the latest SQL Server service pack. I believe this was an
issue in the pre-SP2 version.

Or you can also try this sample (which does not use SQLDMO):
http://www.codeproject.com/cs/database/LocatingSql.asp
hope that helps..
Imran.

"Zack Sessions" <zc********@visionair.com> wrote in message
news:db*************************@posting.google.co m...
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?

Nov 21 '05 #2
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

"Zack Sessions" <zc********@visionair.com> wrote in message
news:db*************************@posting.google.co m...
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?

Nov 21 '05 #3
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

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

"Zack Sessions" <zc********@visionair.com> wrote in message
news:db*************************@posting.google.co m...
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?
Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: arfanameer | last post by:
I have been using SQLDMO listavailableSQLServers . It displays all the servers but it doesnt list the local machine in which SQL Server too is running. Am i missin something?
2
by: musachy | last post by:
My application uses sqldmo to retrieve the list of sql servers in the network, it works fine in some machines, but it is crashing the application in others, no error and no exception, it shuts down...
0
by: hrhoe | last post by:
Hi, I created a simple SQL related program with C#. This program had been working just fine. Since yesterday, the programd does not display two Server's name in the ComboBox list. I used...
1
by: Piotrek Stachowicz | last post by:
Hi, I'd like to display list of all MS SQL servers which are available on the network (I write application which uses database located on one of the machines in my LAN). Has anyone got any idea...
1
by: Michael C | last post by:
Hi all, Not sure if this would be better posted here or in one of the SQL groups, but I'll try here first cause you guys are so smart :) I'm writing an app that uses SQL-DMO to enumerate the...
1
by: Craig G | last post by:
i have the following code in a form load event, that (should) simply populate a combobox with the names of all SQL servers on the network Dim x As Long Dim sqlNameList As SQLDMO.NameList ...
2
by: Craig G | last post by:
i am currently building a small user maintenace system which works across different SQL db's and servers. for a logon screen i am using SQLDMO to get a list of all SQLServers on network, once...
3
by: Brian Henry | last post by:
Anyone know why this would happen... I added a reference to the SQLDMO COM object, imported it on top of my code.. then this test code fails Imports SQLDMO Module Module1 Sub Main() Dim...
1
by: eblackmo | last post by:
I have a test network consisting of four servers running windows 2003 server R2 SP2. I have set up a domain which functioned correctly for about a day and a half until the other servers decided they...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.