Although the examples are written for the Microsoft® Windows® Scripting Host (WSH), you can easily adapt them for Active Server Pages (ASP). The first step is to wrap the VBScript code in the ASP delimiters (<% and %>).
To produce output, change the Wscript.Echo methods to Response.Write methods.
Note Because ASP files default to the VBScript programming language, you need not supply a language qualifier to your VBScript ASP pages. If you use a different language, such as JScript, you must amend the first line of the previous ASP example to the following:
<% SCRIPT LANGUAGE="JScript"
ASP files offer some additional functionality over WSH files. For example, you can create an include file in which can place commonly-used code, such as the following defined constants, which specify the error codes you receive if Search cannot create the object or the object does not exist:
Const E_CREATEOBJECT = 429 ' cannot create object
Const E_NOTEXIST = 424 ' object doesn't exist
You can then include this file in an ASP file with a line of code similar to the following, where SearchInclude.inc is the name of the include file (it can be any legal file name and need not have the .inc file extension):
<!--#include file = "SearchInclude.inc"-->