How can I obtain a list of available SQL Servers from a given client machine ?
In the same sense as I would get a list of servers from the SQL Server Service Manager (or from drop down list when creating ODBC connections) ?
Any clues ?
Steve
I use Microsoft SQLDMO 8.0 library. The code is:
SQLDMO.Application sqlApp = new SQLDMO.Application();
SQLDMO.NameList NL = sqlApp.ListAvailableSQLServers();
for (int i = 1; i <= NL.Count; i++)
cboServers.Items.Add(NL.Item(i).ToString());
The code looked all well and good.
However, when I run it I get the error message :
"QueryInterface for interface SQLDMO.NameList failed."
What would cause this ?
It looks like I'm almost there with it.
Thanks for the help so far.
Steve
Maybe problem is in istalations. Give me you current windows and SQL server instalation status. I mean which service pack you have on windows, on SQL server and version of visual studio.
My current status is :
Servers have windows server 2000 with service pack 4 and the SQL servers 2000 installed have service pack 3. Other computers have windows xp prof with service pack 1 and patches and with MDAC 8. Also we use Visual studio 2003 for development.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.