List Available SQL Servers (Windows NT/2000 only)

Category:
Database
Type:
Snippets
Difficulty:
Intermediate
Author:
Intelligent Solutions Inc.

Version Compatibility: Visual Basic 6

More information:
This example uses SQLDMO to return a string array containing all SQL Servers that are visible to the machine. A reference the the Microsoft SQLDMO library is required. The function works only under Windows NT and 2000 and (because it returns an array) VB 6 or above. However, it is easily modifiable to work under VB 5.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: