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
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.
- 10th March, 2002: Initial post