RegisteredServer Object

SQL-DMO

SQL-DMO

RegisteredServer Object

The RegisteredServer object exposes the attributes of a single, registry-listed instance of Microsoft® SQL Server™.

Properties
Login Property SaLogin Property
Name Property UseTrustedConnection Property
Password Property VersionMajor Property
PersistFlags Property VersionMinor Property
Methods
Remove Method (Objects)
Remarks

SQL-DMO applications can maintain lists of some or all instances of SQL Server in an organization in the registry of a Microsoft Windows NT® 4.0, Microsoft Windows 2000®, or Microsoft Windows® 98 system. The lists establish categories for instances of SQL Server.

For example, to group and view servers by division in a SQL-DMO application, SQL-DMO would represent each division as a ServerGroup object. The division's ServerGroup name is maintained by SQL-DMO as a Windows NT or Windows 95 registry key. Within this registry entry, separate keys list each instance of SQL Server in the division. The list of these keys forms the members of the SQL-DMO RegisteredServers collection, while each key's data is exposed by a RegisteredServer object.

With the RegisteredServer object, you can:

  • Create a Windows NT or Windows 95 registry entry that lists an organization server.

  • Remove a Windows NT or Windows 95 registry entry that lists an instance of SQL Server.

  • Manage a Windows NT or Windows 95 registry entry that lists an instance of SQL Server by setting connection-validation attributes.

The Name property of the RegisteredServer object refers to the instance of SQL Server registered. SQL-DMO does not attempt to validate the Name property value when registering an instance of SQL Server. The RegisteredServer object Name property is validated when the object is used in an attempt to connect to an instance of SQL Server.

After an instance of SQL Server is registered, SQL-DMO uses the properties of the registered server when connecting and when attempting to reconnect after a connection failure. For example, SQL-DMO ignores the szLogin and szPassword parameters of the Connect method of the SQLServer object when that object references an instance of SQL Server registered to use Windows NT Authentication Mode.

To create a registry entry listing an instance of SQL Server

  1. Create a RegisteredServer object.

  2. Set the properties determining connection validation appropriately. For example, set the UseTrustedConnection property to TRUE to enable Windows NT Authentication Mode.

  3. Add the RegisteredServer object to the RegisteredServers collection of the ServerGroup object of an Application object.