Account Options

  1. Sign in
Google Groups Home
« Groups Home
Message from discussion List of SQL Servers in network
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Darren Green  
View profile  
 More options Sep 28 1999, 3:00 am
Newsgroups: microsoft.public.sqlserver.programming
From: Darren Green <dgr...@shortie.demon.co.uk>
Date: 1999/09/28
Subject: Re: List of SQL Servers in network
This code come straight from another current posting, I take no credit -

To enumerate all network-visible SQL servers using SQL-DMO objects,
create a
new standard EXE project and add a reference to sqldmo.rll. This file
can be
found in \Binn\Resources\1033\sqldmo.rll under the SqlServer70
directory.
Now add this code and declaration in your form's code:

Private Function GetAllSqlServerCollection(colSqlServers As Collection)
As
Boolean
    Dim intIndex As Integer
    Dim oApplication As SQLDMO.Application
    Dim oNameList As SQLDMO.NameList

    Set oApplication = New Application
    With oApplication
        Set oNameList = .ListAvailableSQLServers
        With oNameList
            For intIndex = 1 To .Count
                colSqlServers.Add (oNameList.Item(intIndex))
            Next
        End With
    End With
    Set oApplication = Nothing
    GetAllSqlServerCollection = True
End Function

This code quickly fetches a list of SQL servers and can be put inside a
combo box's drop-down event to always get a refreshed list of SQL
servers on
your form.

In article <u3ELpYcC$GA....@cppssbbsa02.microsoft.com>, Johan Thijsen
<jthij...@rug.be> writes

>Hi,

>Does anyone know how you can get a list of all the SQL Server's in the
>network?

>You have something similar if you want to register a server in the
>enterprice manager.

>Thanks in advance,

>Johan Thijsen.

--
Darren Green
SQL/DTS - http://www.swynk.com/friends/green/

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.