Click here to Skip to main content
15,881,877 members
Articles / Programming Languages / VBScript

List SQL Servers on a Network

Rate me:
Please Sign up or sign in to vote.
2.71/5 (14 votes)
10 Mar 2002CPOL 152.9K   5.3K   13   18
An activeX DLL which lists any active SQL servers on your local network

Introduction

This is just something that I needed for a recent application and thought that others may find it useful.

The problem was to enumerate all available SQL Servers on a local network. I decided that the easiest way to do this was to create a VB activeX DLL which could then be referenced by whatever needed to use it (I've tested it in .NET, VB and ASP).

I'm not going to provide a code walkthrough with this, but I've included the VB project and compiled DLL in the source code zip, plus there's a very simple VB application which shows its use.

Essentially it works by making an API call to the netApi32 library (the function it uses is NetServerEnum).

When I have some more time, I will update this article with a full explanation of the code. For now however, things should work pretty much "out of the box", and will hopefully be useful to some of you.

Any problems, then just let me know.

History

  • 10th March, 2002: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionHow i can do it at c#? Pin
blud0ff18-Oct-05 4:04
blud0ff18-Oct-05 4:04 
GeneralAnother (maybe simpeler?) approach Pin
Rogier Reedijk12-Mar-02 1:29
Rogier Reedijk12-Mar-02 1:29 
GeneralRe: Another (maybe simpeler?) approach Pin
21-May-02 2:12
suss21-May-02 2:12 
GeneralRe: Another (maybe simpeler?) approach Pin
Rogier Reedijk22-May-02 1:36
Rogier Reedijk22-May-02 1:36 
GeneralRe: Another (maybe simpeler?) approach Pin
Pettys10-Jul-02 11:00
Pettys10-Jul-02 11:00 
GeneralRe: Another (maybe simpeler?) approach Pin
Anonymous27-May-03 21:46
Anonymous27-May-03 21:46 
GeneralRe: Another (maybe simpeler?) approach Pin
Torsten Mauz29-May-03 0:20
Torsten Mauz29-May-03 0:20 
GeneralRe: Another (maybe simpeler?) approach Pin
grriffin16-Jul-03 6:02
grriffin16-Jul-03 6:02 
GeneralRe: Another (maybe simpeler?) approach Pin
Phil Jeary21-Jun-04 0:06
Phil Jeary21-Jun-04 0:06 
GeneralRe: Another (maybe simpeler?) approach - in VB.Net Pin
Jarosław Zwierz7-Oct-04 5:57
Jarosław Zwierz7-Oct-04 5:57 
GeneralRe: Thanks! Pin
Lantric21-Nov-04 2:58
Lantric21-Nov-04 2:58 
GeneralRe: Another (maybe simpeler?) approach - in VB.Net Pin
Anonymous7-Apr-05 23:12
Anonymous7-Apr-05 23:12 
This code works like a dream. Thanks bud.




GeneralRe: Another (maybe simpeler?) approach - in VB.Net Pin
Frank Esser25-Aug-05 10:26
Frank Esser25-Aug-05 10:26 
QuestionRe: Another (maybe simpeler?) approach - in VB.Net Pin
rugbygeek15-Feb-06 10:00
rugbygeek15-Feb-06 10:00 
AnswerRe: Another (maybe simpeler?) approach - in VB.Net Pin
Polymorpher13-Jun-06 3:44
Polymorpher13-Jun-06 3:44 
GeneralRe: Another (maybe simpeler?) approach - in VB.Net Pin
Lokanatha Reddy16-Jan-07 19:56
Lokanatha Reddy16-Jan-07 19:56 
GeneralRe: Another (maybe simpeler?) approach - in VB.Net Pin
Polymorpher13-Jun-06 3:41
Polymorpher13-Jun-06 3:41 
GeneralRe: Another (maybe simpeler?) approach - in VB.Net Pin
Lokanatha Reddy22-Jan-07 0:53
Lokanatha Reddy22-Jan-07 0:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.