Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How have a list with all the SQL server in my entire network?

Status
Not open for further replies.

dicolas

Technical User
Joined
Oct 22, 2001
Messages
7
Location
CA
Hi,
I would like to automatically create an ODBC DSN.
But I don't know how to retrieve the available SQL server in my network (such as the list you can find into the ODBC Data Source Administrator.)

Thanks for your help.
Dicolas.
 
Hey there, when you install SQLDMO on your machine, usually installs with the desktop edition of SQL Server on a development machine, you get access to some new methods and properties through the Application object. Using both the Application object and SQLDMO in your application you should be able to gather the SQL servers that are network-visable. Here is the code I used.


Dim i As Integer
Dim oNL As NameList

Set oNL = Application.ListAvailableSQLServers
For i = 0 To oNL.Count
Debug.Print oNL.Item(i)
Next i


Work great for me.

MattU
 
thank you very much.

Have a nice day. Mine is beginning fine.

Hi MattU
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top