Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

List SQL Servers on a Network

0.00/5 (No votes)
10 Mar 2002 1  
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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here