Click here to Skip to main content
6,822,123 members and growing! (17,382 online)
Email Password   helpLost your password?
Languages » VBScript » General     Intermediate License: The Code Project Open License (CPOL)

List SQL Servers on a Network

By Torsten Mauz

An activeX DLL which lists any active SQL servers on your local network
VB6, VBScript, Windows, Dev
Revision:2 (See All)
Posted:10 Mar 2002
Views:94,259
Bookmarked:12 times
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
17 votes for this article.
Popularity: 3.38 Rating: 2.75 out of 5
5 votes, 35.7%
1
1 vote, 7.1%
2
1 vote, 7.1%
3
2 votes, 14.3%
4
5 votes, 35.7%
5

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)

About the Author

Torsten Mauz


Member

Occupation: Web Developer
Location: United Kingdom United Kingdom

Other popular VBScript articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 18 of 18 (Total in Forum: 18) (Refresh)FirstPrevNext
GeneralHow i can do it at c#? Pinmemberblud0ff5:04 18 Oct '05  
GeneralAnother (maybe simpeler?) approach PinmemberRogier Reedijk2:29 12 Mar '02  
GeneralRe: Another (maybe simpeler?) approach Pinmembermostevil3:12 21 May '02  
GeneralRe: Another (maybe simpeler?) approach PinmemberRogier Reedijk2:36 22 May '02  
GeneralRe: Another (maybe simpeler?) approach PinmemberPettys12:00 10 Jul '02  
GeneralRe: Another (maybe simpeler?) approach PinsussAnonymous22:46 27 May '03  
GeneralRe: Another (maybe simpeler?) approach PinmemberTorsten Mauz1:20 29 May '03  
GeneralRe: Another (maybe simpeler?) approach Pinmemberhaberdasher7:02 16 Jul '03  
GeneralRe: Another (maybe simpeler?) approach PinmemberPhil Jeary1:06 21 Jun '04  
GeneralRe: Another (maybe simpeler?) approach - in VB.Net Pinmemberzjerry6:57 7 Oct '04  
GeneralRe: Thanks! PinmemberLantric3:58 21 Nov '04  
GeneralRe: Another (maybe simpeler?) approach - in VB.Net PinsussAnonymous0:12 8 Apr '05  
GeneralRe: Another (maybe simpeler?) approach - in VB.Net PinmemberFrank Esser11:26 25 Aug '05  
QuestionRe: Another (maybe simpeler?) approach - in VB.Net Pinmemberrugbygeek11:00 15 Feb '06  
AnswerRe: Another (maybe simpeler?) approach - in VB.Net PinmemberPolymorpher4:44 13 Jun '06  
GeneralRe: Another (maybe simpeler?) approach - in VB.Net PinmemberLokanatha Reddy20:56 16 Jan '07  
GeneralRe: Another (maybe simpeler?) approach - in VB.Net PinmemberPolymorpher4:41 13 Jun '06  
GeneralRe: Another (maybe simpeler?) approach - in VB.Net PinmemberLokanatha Reddy1:53 22 Jan '07  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

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

PermaLink | Privacy | Terms of Use
Last Updated: 10 Mar 2002
Editor: Deeksha Shenoy
Copyright 2002 by Torsten Mauz
Everything else Copyright © CodeProject, 1999-2010
Web19 | Advertise on the Code Project