Microsoft KB Archive/841771

= All the instances of SQL Server or SQL Server Desktop Engine are not enumerated when you use an application or a method that uses SQLBrowseConnect =

Article ID: 841771

Article Last Modified on 7/12/2004

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition
 * Microsoft SQL Server 2000 Desktop Engine (Windows)

-



SYMPTOMS
If you try to enumerate the instances of Microsoft SQL Server 2000 or SQL Server Desktop Engine (also known as MSDE 2000) by using an application or a method in a program, all the instances of SQL Server or SQL Server Desktop Engine are not enumerated. This problem may occur when the application or the method uses the SQLBrowseConnect Microsoft Open Database Connectivity (ODBC) API to enumerate the instances of SQL Server or SQL Server Desktop Engine.



MORE INFORMATION
You can use an application, such as Osql.exe, or a method, such as the ListInstalledInstances SQL Distributed Management Objects (SQL-DMO) method, to enumerate the instances of SQL Server or SQL Server Desktop Engine. The application and the method use the SQLBrowseConnect ODBC API to enumerate the instances of SQL Server or SQL Server Desktop Engine.

The SQLBrowseConnect ODBC API uses the User Datagram Protocol (UDP) listener to determine the instances of SQL Server or SQL Server Desktop Engine that are running on a remote computer. An instance of SQL Server or SQL Server Desktop Engine that has any one of the network protocols that are enabled and running on the remote computer becomes the UDP listener.

The following behaviors are expected when you use the SQLBrowseConnect ODBC API to enumerate the instances of SQL Server or SQL Server Desktop Engine:
 * An instance of SQL Server or SQL Server Desktop Engine is qualified for enumeration if the following conditions are true:
 * The instance has at least one network protocol enabled.
 * The instance is not a hidden instance.
 * For a local computer, all the qualified instances are enumerated, even if the instances are not running.
 * For a remote computer, all the qualified instances are enumerated only if one or more of the qualified instances are running.

By reading the information from the registry, you can enumerate all the instances of SQL Server and SQL Server Desktop Engine that are installed on a computer, even when the instances are not running or when the protocols are not enabled for the instances. The list of instances of SQL Server and SQL Server Desktop Engine that are installed on a computer is stored in the following registry key on the computer:

