Setting Up IIS to Run ASP Pages - asp.dll

This section provides a tutorial example on how to set up IIS 5.0 to run ASP pages. The important step is to link the .asp extension to the asp.dll library.

In order to play with server-side scripting with VBScript, we need to know enough about IIS to configure it to support the ASP technology.

Step I - Making Sure IIS 5.0 Is Running

Internet Information Services (IIS) 5.0 is a Microsoft product, that offers and manages the Internet services, like web (HTTP) server, and email (SMTP) server.

IIS 5.0 is installed on Windows 2000 by default. I did the following to make sure the web server is working:

1. Go to Control Panel, then Administrative Tools, then Services, and make sure that IIS Admin Service is Started, and World Wide web Publishing Service is Started.

2. Go to Control Panel, then Administrative Tools, then Internet Services Manager, and make sure that the Default Web Site under your local host name is running. If not, right mouse click on Default Web Site, and select Start command.

3. Create the following hello.html file:

<html><body>Hello world!</body></html>

4. Copy hello.html to \inetpub\wwwroot, which is the directory where the web server will take the web page files.

5. Run Internet Explorer (IE) with this url: http://localhost/hello.html.

6. If you see "Hello world!" on IE window, you know your IIS web server is serving HTML pages.

Step II - Making sure IIS 5.0 Is Supporting ASP Pages

1. Go to Control Panel, then Administrative Tools, then Internet Services Manager, and right mouse click on Default Web Site, then select properties command.

2. Click on Home Directory tab on the properties dialog box, then click the Configuration button.

3. Click on App Mappings tab on the configuration dialog box, then check to see the following line in the mapping area.

Extension   Executable Path                     Verbs

.asp        c:\winnt\system32\inetsrv\asp.dll   GET,HEAD,POST,TRACE

4. Create the following hello.asp file:

<%@ language="vbscript"%>
<html><body>
<%
response.write("Hello world!")
%>
</body></html>

5. Copy hello.asp to \inetpub\wwwroot, which is the directory where the web server will take the ASP page files.

6. Run Internet Explorer (IE) with this url: http://localhost/hello.asp.

6. If you see "Hello world!" on the IE window, you know your IIS web server is serving ASP pages.

Step III - Reviewing IIS 5.0 Settings

If you are serious about managing your IIS server, you should go to the properties dialog box on the Default Web Site on Internet Services Manager, and review all the settings. Here are some interesting ones:

Table of Contents

 About This Book

 Introduction of VBScript - Visual Basic Scripting Edition

 Variant Data Type, Subtypes, and Literals

 Arithmetic Operations

 Numeric Comparison Operations and Logical Operations

 String Operations - Concatenation and Comparison

 Variable Declaration and Assignment Statement

 Expression and Order of Operation Precedence

 Statement Syntax and Statement Types

 Array Data Type and Related Statements

 Array References and Array Assignment Statements

 Conditional Statements - "If ... Then" and "Select Case"

 Loop Statements - "For", "While", and "Do"

 "Function" and "Sub" Procedures

 Built-in Functions

 Inspecting Variables Received in Procedures

 Error Handling Flag and the "Err" Object

 Regular Expression Pattern Match and Replacement

 scrrun.dll - Scripting Runtime DLL Library

 Creating Your Own Classes

 IE Web Browser Supporting VBScript

IIS ASP Server Supporting VBScript

 What is ASP (Active Server Pages)?

 Static, Client-Side and Server-Side Scripting Pages

Setting Up IIS to Run ASP Pages - asp.dll

 ASP Objects: Request, Response, Session and Application

 ASP Object Example - Passing Values between Pages

 Interacting with External Applications - ActiveX Data Object (ADO)

 WSH (Windows Script Host)

 References

 Full Version in PDF/EPUB