Explore

SQL-DMO

SQL-DMO

Explore

The Explore sample guides a user through the SQL-DMO object tree, displaying the contents of collections and the properties of objects. The sample illustrates using the Properties collection and handling SQLServer2 object events.

Default Location

C:\Program Files\Microsoft SQL Server\80\Tools\Devtools\Samples\sqldmo\vb\explore

Running the Sample
  1. Open the Explore.vbp project.

  2. Run the application.
Remarks

The Explore sample contains a single form, shown in the illustration. The form solicits login information from the user.

Upon successful connection to an indicated instance of Microsoft® SQL Server™, SQLServer2 object properties and their values are displayed in the box at the bottom of the form. The first combo box is enabled, containing SQL-DMO objects and collections dependent upon the SQLServer2 object. User selection in the combo boxes and lists navigates the user through the configuration of the indicated server.

The Explore sample makes heavy use of the automated properties collection available to automation controllers in iterating property names and their values. The Explore sample is only compatible with instances of SQL Server 2000 because it iterates many properties that are only compatible with instances SQL Server 2000. An application that also must be compatible with earlier versions of SQL Server can use the VersionMajor property to determine the version of the server to which it connects prior to referencing a specific property or method. For information about compatibility of a specific SQL-DMO object, property, or method, refer to the specific topic in SQL-DMO Reference.

Note  Although the sample allows the user to use either Windows Authentication or SQL Server Authentication, the recommended method for connecting to an instance of SQL Server 2000 is to use Windows Authentication mode.

See Also

SQL-DMO Samples