Export (0) Print
Expand All
Expand Minimize

Modifying the Samples

The ASP samples are designed to work on the local member; however, you can change them and use them to monitor your SQL server and databases. These changes include altering the connection string and the tables to which these samples point. As well, some of them require other changes, such as creating DSNs or stored procedures on the remote database.

You can use any text editor to make these changes, such as Microsoft Visual Studio®.

Specific Changes Required

You can change each ASP sample to provide monitoring functionality for any OLE-compliant database. The following list describes the specific changes that you need to complete for each file. For each example in the following list, substitute the italicized items with the correct values.

  • Helloworld.asp. This .mof file is used to create and register classes in WMI. The file is compiled and registered during Application Center Setup. These WMI classes define data groups, data collectors, thresholds, actions, and performance counters. Change the connection string as follows:

    strConn="Provider=SQLOLEDB; Data Source= database_server_name ; Initial Catalog= database ;" & _ " User ID= user_name ; Password= password "

  • Verifysp.asp. The following example shows how to change to URL and query string to suit your requirements:

    "http:// URL_of_sample_directory /VerifySP.asp?cs=Provider=SQLOLEDB;%20Data%20Source= database_server_name ;%20Initial%20Catalog= database ;%20User%20ID= username ;%20Password= password &sp=Hello('World')"

    Run the file Hello.sql on the remote database to install the stored procedure Hello, which is done in the SQL Server Query Analyzer.

  • Adotest.asp. Change the connection string as follows:

    strConn = "Provider=SQLOLEDB; Data Source= database_server_name ; Initial Catalog= database ;" & _ " User ID= user_name ; Password= password "

    Change the table that is queried as follows:

    "objRec.Open "select count(*) from table_name "

  • Eventclassescount.asp. Change the connection string as follows:

    strConn = "Provider=SQLOLEDB; Data Source= database_server_name ; Initial Catalog= database ;" & _ " User ID= user_name ; Password= password "

    Change the table that is queried as follows:

    "objRec.Open "select count(*) from table_name "

  • Serverlist.asp. Do not change this application. It is designed to test the Application Center Events and Performance Logging tables on the members.

  • Dnseventclasses.asp. Change the connection string as follows:

    strConn = "DSN= DSN_name ;User ID= user_name ; Password= password

    Change the table that is queried as follows:

    "objRec.Open "select count(*) from table_name "

    Bb687504.note(en-us,TechNet.10).gif Note   To use this sample, you must create a DSN.

Related Topics

  • For more information about creating DSNs, see the Windows 2000 Help.

  • For more information about running SQL statements, see the SQL Server Help.

Did you find this information useful? Please send your suggestions and comments about the documentation to acdocs@microsoft.com

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft