Partager via


SQLServers Collection

Cette fonctionnalité sera supprimée dans une prochaine version de Microsoft SQL Server. Évitez d'utiliser cette fonctionnalité dans de nouveaux travaux de développement et prévoyez de modifier les applications qui utilisent actuellement cette fonctionnalité.

The SQLServers collection contains SQLServer objects created by the SQL Distributed Management Objects (SQL-DMO) application.

Modèle objet SQL-DMO qui affiche l'objet en cours

Properties

Notes

SQL-DMO maintains the SQLServers collection. Members are added when the application creates a new instance of a SQLServer object and are removed when the application releases all references it holds on the member. For example:

Dim     oSQLServer as SQLDMO.SQLServer
' SQLServer object not created. No member in SQLServers collection.

Set oSQLServer = New SQLDMO.SQLServer
' SQLServer object is now a member of the SQLServers collection.

Set oSQLServer = Nothing 
' SQLServer object references released and member removed
' from SQLServers collection.

When using the Item method, the SQLServers collection supports member identification using either name or ordinal reference syntax. For example:

Set oSQLServer = oApplication.SQLServers("SEATTLE1")

Or:

Set oSQLServer = oApplication.SQLServers(2)