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 (841771)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)
  • Microsoft SQL Server 2000 Desktop Engine (MSDE)

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:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\InstalledInstances

REFERENCES

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

814064 FIX: SQLBrowseConnect may cause an access violation in the client application


Modification Type:MajorLast Reviewed:7/12/2004
Keywords:kbtshoot kbRegistry kbLocalSvr kbProgramming kbenable kbprb KB841771 kbAudDeveloper