APPENDIX B
ASP on Alternative Platforms

Throughout this book, I have discussed ASP in terms of its use on Microsoft web
servers (Internet Information Server, Peer Web Services, and Personal Web Server)
using servers running Microsoft operating systems. However, as ASP applications
gain in popularity, there is increasing demand for this web application development
platform. Several third-party vendors are beginning to answer this demand
by providing solutions that range in maturity from beta to full-strength productionquality
software.
In this appendix, I will briefly describe the few available options for developing
ASP on non-Microsoft platform products.
Chili!ASP from Chili!Soft
Chili!Soft’s Chili!ASP product is the most evolved alternative environment available
for running your ASP applications. It is a functional and syntactic equivalent of
Microsoft’s Active Server part of IIS, allowing developers to build ASP applications
that run on many web servers on both Windows NT and Sun Solaris. See
Table B-1 for details. Support for other platforms (notably AIX and OS/390) is in
the works.
Table B-1: Platforms Supported by Chili!ASP
Operating System Web Server Status
Windows NT Apache 1.3.3 Beta
Netscape Enterprise 2.01, 3.0, 3.51
Netscape FastTrack 2.01, 3.01
Production
IBM ICSS 4.2 Production
Lotus Go Webserver 4.6 Production
Lotus Domino 4.6.1 Production
378 Appendix B – ASP on Alternative Platforms
Instant ASP (I-ASP) from Halcyon Software
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
Comments
Chili!Soft’s implementation of ASP is by far the most advanced of the non-
Microsoft alternatives. My experience with their products was good. The products
installed as their instructions suggested they would, and I was able to write for my
Windows NT server and then run the same code on another platform.
Chili!Soft’s Chili!ASP is a complete production-quality ASP solution for large firms
looking to write ASP on high-volume servers. However, if you have only a small
number of users or a small bandwidth connection, the cost of Chili!ASP is somewhat
prohibitive.
Contact Information
Chili!Soft
2700 Richards Road
Suite 103
Bellevue, WA 98005
Phone: (425) 957-1122
Fax: (425) 562-9565
http://www.chilisoft.com
Instant ASP (I-ASP) from Halcyon Software
Halcyon Software’s Instant ASP (I-ASP) is currently under development, and I was
unable to obtain a copy before this book went to press. However, it looks like it
will be a real contender for Chili!Soft’s implementation, Chili!ASP.
I-ASP is being developed in Javaä as a Java servlet. As such, Halcyon claims, you
will be able to use it on most web servers that implement Java runtimes. See
Table B-2 for the advertised list of web servers. Furthermore, Halcyon claims that
it will provide developers with the capability to use not only ActiveX (including
Active Data Objects), but also Enterprise JavaBeans or CORBA-compliant objects.
Finally, I-ASP will also support JavaServer Pages and remote debugging.
Sun Solaris Netscape Enterprise 3.51
Netscape FastTrack 2.0
Production
Apache In development
AIX Unknown In development
OS/390 Unknown In development
Table B-2: Platforms Supported by I-ASP
Operating System Web Server Status
Sun Sparc/Intel Apache, Sun WebServer, Java
WebServer, FastTrack, Enterprise
Server
In development
Table B-1: Platforms Supported by Chili!ASP (continued)
Operating System Web Server Status
OpenASP from the ActiveScripting Organization 379
Multiplatform ASP
OpenASP from the ActiveScripting Organization
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
Comments
The claims that Halcyon makes about I-ASP sound very promising. They hope to
go to beta about the time this book goes to press.
Contact Information
Halcyon Software
50 W San Fernando St. #1015
San Jose, CA 95113
Phone: (408) 998-1998
http://www.halcyonsoft.com
OpenASP from the ActiveScripting
Organization
The ActiveScripting Organization, started in August of 1998, is a group within
Summit Software Company. This group is constructing Open Source software solutions
that will allow developers to host ASP applications on several non-Microsoft
web servers. Currently this project’s focus is the creation of ASP support for the
Apache web server. See Table B-3 for details.
IBM RS/6000 Apache, FastTrack, Enterprise
Server, WebSphere, Lotus Domino
In development
IBM AS/400 Apache, WebSphere, Lotus
Domino
In development
IBM OS/2 Apache In development
Linux/Intel Apache In development
Novell Netware 4.0/5.0 FastTrack, Enterprise Server In development
SCO Apache, FastTrack, Enterprise
Server
In development
Macintosh Apache, WebStar, WebTen In development
HPUX Apache In development
SGI Apache In development
Windows NT/98 Apache, IIS, FastTrack, Enterprise
Server
In development
Table B-3: Platforms Supported by OpenASP
Operating System Web Server Status
Windows NT Apache 1.3.x Beta
Sun Solaris Apache In development
Linux Apache In development
Table B-2: Platforms Supported by I-ASP (continued)
Operating System Web Server Status
380 Appendix B – ASP on Alternative Platforms
OpenASP from the ActiveScripting Organization
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
Comments
Like many authors at O’Reilly, I’m a big supporter of additions to the free software
arena. I’m very excited about OpenASP. Currently, however, this is a very
immature product in terms of support for ASP. Table B-4 (from the readme.txt file
from OpenASP for Apache) reports the level of support for various ASP features.
Table B-4: OpenASP’s Support for ASP Functionality
Feature Supported
ObjectContext Object No
Request Partial (collection must be specified)
Request.ClientCertificate No
Request.QueryString Yes
Request.Form Yes
Request.Cookies Yes
Request.ServerVariables Yes
Request.TotalBytes No
Request.BinaryRead No
Response Partial
Response.Buffer Yes
Response.CacheControl No
Response.Charset No
Response.ContentType Yes
Response.Expires Yes
Response.ExpiresAbsolute No (almost supported)
Response.IsClientConnected No
Response.Pics No
Response.Status No
Response.AddHeader Yes
Response.AppendToLog Yes
Response.BinaryWrite Yes
Response.Clear Yes
Response.End Yes
Response.Flush Yes
Response.Redirect Yes
Response.Write Yes
Server Partial
Server.CreateObject Yes
Server.HTMLEncode Yes
Server.MapPath Yes
Server.ScriptTimeout No
Server.URLEncode Yes
OpenASP from the ActiveScripting Organization 381
Multiplatform ASP
OpenASP from the ActiveScripting Organization
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
Contact Information
http://www.activescripting.org
Session Yes
Session.Abandon Yes
Session.CodePage No
Session.Contents Yes
Session.LCID No
Session.SessionID Yes
Session.StaticObjects No
Session.Timeout Yes
Session_OnStart Yes
Session_OnEnd No
Application Yes
Application.Contents Yes
Application.Lock Yes
Application.Unlock Yes
Application.StaticObjects No
Application_OnStart Yes
Application_OnEnd No
Standard Base Components No
GLOBAL.ASA No
Table B-4: OpenASP’s Support for ASP Functionality (continued)
Feature Supported
382
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
Appendix CASP on IIS
APPENDIX C
Configuration of ASP
Applications on IIS
To cover all aspects of configuration for Internet Information Server is beyond the
scope of this book. However, it is important to understand, at an introductory
level, how information for IIS is stored and how to configure your virtual directories
for your ASP applications
Microsoft Management Console
and the Metabase
Microsoft’s new Management Console (MMC) allows you to configure and administer
several server applications in your enterprise, from SQL Server 7.0 to Site
Server to Transaction Server to Internet Information Server. This console application
allows you to administer several aspects of your enterprise that previously
required you to master several separate applications without a consistent interface.
Microsoft’s goal is that MMC eventually be used to control all segments of
Microsoft BackOffice.
It is important to note, however, that MMC itself is not actually doing anything.
MMC is simply a container for administration programs called snap-ins. The interface
of the MMC is published, and third parties can write their own snap-ins in
addition to those provided by Microsoft.
The snap-in for administration of Internet Information Server is similar to all other
snap-ins. Each snap-in consists of two panes (see Figure C-1). The left pane, called
the scope pane, displays a hierarchical view of all the items that can be administered
by this snap-in. As you would expect, administering high-level items in this
pane affects those items located hierarchically below them. For example, if you
administer the properties of the web server itself, all the web sites located under it
also are affected.
This simplification of IIS administration is not the only thing to change since IIS 3.0.
Also changed is the location where information about your web server’s adminis-
Microsoft Management Console and the Metabase 383
ASP on IIS
Microsoft Management Console and the Metabase
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
tration is stored. In IIS 3.0, this information was stored in the system registry; now
it is stored in the metabase.
The metabase is a memory-resident data store that was designed to be faster and
more flexible than the registry. You use a snap-in called IIS Admin Objects to
administer the metabase directly. This makes direct manipulation of the metabase
more complex than manipulation of the registry. It is important to note that when
you are changing the properties of various items in IIS, you are actually changing
IIS Admin Objects behind the scenes. After changes have been made, the IIS snapin
writes them to the metabase. Finally, the metabase is stored to your server’s
drive upon exiting IIS. It is loaded into memory each time you open the IIS snapin.
The metabase can also be backed up and restored using a Windows Scripting Host
(WSH) script that is included in the IIS samples directory when you install WSH.
You must have WSH installed to use these scripts.
Similar to the registry in architecture, information in the metabase is stored in
metabase keys that correspond to the various items in IIS. Each key has corresponding
metabase properties. These metabase properties have values that change
to reflect your administration of the item in question. Almost all the properties
from IIS that were stored in the registry in IIS 3.0 are now stored in the metabase.
For more information on the metabase, visit www.microsoft.com.
Figure C-1: The Microsoft Management Console
384 Appendix C – Configuration of ASP Applications on IIS
Microsoft Management Console and the Metabase
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
ASP Application Configuration
Before you can create an ASP application, you must create a virtual directory. To
create a virtual directory on your web server, follow these steps (see Figure C-2):
1. Right-click the web server on which you wish to create a virtual directory.
2. From the pop-up menu, select New Ý Virtual Directory.
3. Select a name for your virtual directory.
4. Select a physical directory to which your virtual directory is mapped.
5. Leave the default access (Allow Read Access and Allow Script Access) for ASP
applications.
Now that you have created your virtual directory, you must configure it for your
ASP application. To do this, right-click your virtual directory and select Properties
from the pop-up menu to open the Properties dialog shown in Figure C-3.
From this Virtual Directory tab, you can configure several features of your virtual
directory. Before discussing those properties that affect ASP, let’s briefly go over
what the other tabs on this dialog do. The Documents tab allows you to set the
default document for your virtual directory and/or enable document footers. The
Directory Security tab, as its name implies, allows you to set various security
settings for the virtual directory, including NT rights to the underlying physical
directory. The HTTP Headers tab allows you to enable content expiration, add
custom HTTP headers, edit your Content Rating settings, or edit your MIME Map.
Finally the Custom Errors tab allows you to set the paths to custom error files that
the web server will use instead of its default files.
Use the Virtual Directory tab shown in Figure C-3 to configure your ASP settings.
At the top of the page, you can define where the content for your virtual directory
should come. This is straightforward. The bottom allows you to set various properties,
such as the physical directory, access (read/write) settings for your directory,
Figure C-2: Selecting access permissions
Microsoft Management Console and the Metabase 385
ASP on IIS
Microsoft Management Console and the Metabase
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
logging settings, and whether you want your virtual directory indexed. It also
allows you to set the permissions (Read/Script/Execute) for your virtual directory.
If you are only going to be using ASP (and not CGI) within your virtual directory,
then leave the default setting (Script).
Finally, this page allows you to define whether you want your ASP application to
run in the same memory space as the web server (the default) or in a separate
memory space. Leaving the default allows for faster execution time for your script,
but running your application in its own memory space avoids bringing down the
web server if your application commits a critical error. The choice is yours.
Also from the page shown in Figure C-3, you can click on the Configuration
button to configure the application options for your application. The first settings
that you can configure from this page are the application mappings. The App
Mappings tab, which is shown in Figure C-4, allows you to map file extensions to
the ISAPI filters that IIS will use to execute or read that file. For example, for .ASP
files, IIS uses c:\WINNT\SYSTEM32\INETSRV\ASP.DLL. If you wanted to use Perl
scripts in your virtual directory, you would use this tab to map the Perl file extensions
(.PL or .PLX) to your Perl executable or your PerlIS DLL.
The App Options tab, which is shown in Figure C-5, allows you to configure
various application options. From here, you can enable or disable the use of
session state and define how long session information is saved on the server. You
can control whether you want all ASP output buffered before it is sent. (See
Chapter 7, Response Object, for more on buffering.) You can determine whether to
allow your ASP applications access to information in parent directories using rela-
Figure C-3: The Virtual Directory Properties page
386 Appendix C – Configuration of ASP Applications on IIS
Microsoft Management Console and the Metabase
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
tive paths (the “../” syntax). If you leave this set to True, make sure the parent
directories of the current ASP directories have their Execute permission set to
False. Otherwise, an ASP script could execute an application on the server using
this syntax.
This page also allows you to set the default scripting language to any supported
language. Not surprisingly, VBScript is the default. Finally, this page allows you to
set the ASP script timeout in seconds. If you do not want any script in your virtual
Figure C-4: The App Mappings tab
Figure C-5: The App Options tab
Microsoft Management Console and the Metabase 387
ASP on IIS
Microsoft Management Console and the Metabase
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
directory to be executed on the server for longer than 30 seconds, set this value to
30, for example.
App Debugging, the final tab in the Application Configuration dialog, is shown in
Figure C-6; it allows you to set up debugging. If your development environment
supports server-side debugging, you can enable it here. The client-side debugging
checkbox is ignored by the server. The last option on this page is whether to send
your users detailed ASP error information or a custom message. Often, for security
reasons, it may be best to create a detailed custom message. Otherwise, your web
server could reveal details about the script that you might want to keep secret.
Figure C-6: The App Debugging tab

389
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
Index
. and .. for directories, 119
<%…%> delimiters, 15
<%@ ... %> directive syntax, 141
<%=…%> delimiters, 16–19
A
Abandon method (Session), 136–138
aborting transactions, 42, 43
AbsolutePage property (Recordset), 171
AbsolutePosition property (Recordset),
171, 174–176
Access component, 316–345
file system object model, 317–324
methods reference, 334–345
properties reference, 324–334
ACTION attribute (<FORM>), 71
Active Messaging (see CDO for NTS)
ActiveConnection property, 176–177
Connection object, 164
Recordset object, 171
ActiveScripting Organization, 379
ActiveX controls
HTML forms with, 73
ActiveX Data Objects (see ADO)
ActualSize property (Field), 168
Ad Rotator component, 236–247
example of using, 244–247
GetAdvertisement method, 236, 243
instantiating, 240
properties reference, 241–243
required files, 237
rotator schedule file, 238–239, 245
Add method
Attachments collection, 263
Contents collection and, 33
Folders collection, 323
Messages collection, 265
Recipients collection, 268
AddHeader method (Response), 104
AddNew method (Recordset), 173,
207–209
Address property
AddressEntry object, 261
Recipient object, 267
AddressEntry object, 261
ADO (ActiveX Data Objects), 159–235
application-level objects to maintain
connections, 29
DLLs required for, 161
Errors collection (Connection), 206
instantiating, 161–162
methods reference, 207–235
object model, 163–173
properties reference, 174–206
adovbs.inc file, 161
Adrot.dll library, 237
advertisements (see Ad Rotator
component)
390 Index
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
ALL_HTTP element (ServerVariables),
77
ALL_HTTP environment variable, 376
ALL_RAW element (ServerVariables), 78
App Debugging tab (MMC), 387
App Mappings tab (MMC), 385
App Options tab (MMC), 385
AppendChunk collection
Field object, 169
Parameter object, 170
AppendToLog method (Response), 105,
139
APPL_MD_PATH element
(ServerVariables), 78
APPL_PHYSICAL_PATH element
(ServerVariables), 78
APPL_PHYSICAL_PATH environment
variable, 372
Application object, 10, 27–40
collections reference, 30–36
methods reference, 36–38
OnStart and OnEnd events, 10, 38–40
GLOBAL.ASA file for, 150, 151–153
Application property (CDO), 259, 260
application-level scope, 10, 28–30
corresponding type libraries, 155
creating objects with, 117
objects added with <OBJECT>, 34
transactional objects and, 43, 136
applications
counter variables and, 309
file manipulation capabilities,
316–345
page-level counters, 356
user sessions and, 123
arrays
adding to Contents collection, 33, 132
ASN.1 identifiers, 61
ASP (Active Server Pages)
configuring on IIS, 382–387
converting CGI to, 365–376
functions, 19–22
introduction and demonstration, 6–9
non-Microsoft platforms, 377–381
object model, 9–11
scripts calling themselves, 71–73
ASPBufferingOn setting, 87
AspScriptTimeout property, 115
AtEndOfLine property (TextStream),
324
AtEndOfStream property
FileSystemObject object, 325
TextStream object, 324
AttachFile method (NewMail), 267, 280
Attachment object, 262
Attachments collection (Message), 263,
265
Attachments property (Message), 264
attachments to messages, 262–263,
280–283
AttachURL method (NewMail), 267,
281–283
Attributes property, 319, 322, 326–328
Parameter object, 169
Property object, 170
Attributes property (Connection), 165
Attributes property (Field), 168
AUTH_PASSWORD element
(ServerVariables), 78
AUTH_TYPE element (ServerVariables),
78
AUTH_TYPE environment variable, 372,
374
AUTH_USER element (ServerVariables),
78
authentication information in HTTP
request, 78
AvailableSpace property (Drive), 318,
328
B
Background property (MyInfo), 350
Basic Clear Text authentication, 358,
360
batch-update mode, 208
deleting recordsets, 214
Bcc property (NewMail), 266, 268
BeginTrans method (Connection), 166
BinaryRead method (Request), 82–84
BinaryWrite method (Response),
106–108
blind carbon copies, 268
Body property (NewMail), 266, 269
<BODY> tags, server-side functions in,
21
Index 391
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
BodyFormat property (NewMail), 266,
270
BOF property (Recordset), 171, 178–179
Bookmark property (Recordset), 171
Border property (Ad Rotator), 241
borders around advertisement graphics,
241
BrowsCap.dll library, 249
BrowsCap.ini file, 249–253
Browser Capabilities component, 23,
248–255
instantiating, 253
PropertyName property, 254
required files, 249–253
browsers (see web browsers)
BrowserType object, creating, 248–255
Buffer property (Response), 87–90
clearing, 108
End method and, 109
BuildPath method (FileSystemObject),
321
C
CacheControl property (Response), 90
CacheSize property (Recordset), 171
caching web pages, 90
expiring cache, 93–95
CancelBatch method (Recordset), 173
CancelUpdate method (Recordset), 173
carbon copies, 271
carriage return, writing, 112
Cc property (NewMail), 266, 271
CDO for Exchange, 257
CDO for NTS, 256–285
instantiating CDOs, 257
object model, 259–268
version of, 280
Cdonts.DLL library, 257
ceCertPresent constant, 60
CERT_COOKIE element
(ServerVariables), 78
CERT_FLAGS element (ServerVariables),
78
CERT_ISSUER element
(ServerVariables), 79
CERT_KEYSIZE element
(ServerVariables), 79
CERT_SECRETKEYSIZE element
(ServerVariables), 79
CERT_SERIALNUMBER element
(ServerVariables), 79
CERT_SERVER_ISSUER element
(ServerVariables), 79
CERT_SERVER_SUBJECT element
(ServerVariables), 79
CERT_SUBJECT element
(ServerVariables), 79
Certificate value (Key property), 60
certificates (see digital certificates)
ceUnrecognizedIssuer constant, 60
CGI applications, 3
converting to ASP applications,
365–376
environment variables, 372–376
version used by web server, 79
CGI_ variables (WinCGI), 374–376
character sets
code page for dynamic content, 125
setting, 142
character sets for HTTP responses, 91
Charset property (Response), 91
Chili!ASP product, 377
ChooseContent method (Content
Rotator), 306
Chr function, 112
Class property (CDO), 259, 260
Clear method (Response), 108
Clickable property (Ad Rotator), 242
client certificates (see digital
certificates)
ClientCertificate collection (Request),
59–63, 78
ClientCustomHeader header, 104
client-side scripting, 12–14
as dynamic script output, 16
Clone method (Recordset), 173,
209–211
Close method, 211–212
Connection object, 166
Recordset object, 173
TextStream object, 324, 334
closing
text files, 334
data servers or recordsets, 211–212
code reuse, 19–22
CODEPAGE directive, 126, 142
392 Index
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
CodePage property (Session), 125–126,
142
Collaboration Data Objects (see CDO
for NTS)
Column property (TextStream), 324
COM objects
ADO (see ADO)
CDO for NTS (see CDO for NTS)
type libraries, 155–156
Command object (ADO), 163–165
commands, database (see database
commands)
CommandText property
Command object, 179–181
Connection object, 164
CommandTimeout property, 164, 165,
181–183
CommandType property
Command object, 183–185
Connection object, 164
comments and troubleshooting
Ad Rotator component, 240
ADO with ASP, 163
Browser Capabilities component, 253
CDO for NTS, 258
Content Linking component, 289
Content Rotator component, 306
Counters component, 311
File Access components, 317
global variables, 28–30
GLOBAL.ASA file, 150
MyInfo component, 349
Page Counter component, 356
Permission Checker, 360
preprocessor directives, 142
QueryString collection length, 75
Request object, 57
Response object, 86
server-side includes, 146
Session object, 123–125
transactional scripts, 42
committing transactions, 42, 45
CommitTrans method (Connection),
166
Common Gateway Interface (CGI), 3
version used by web server, 79
CommunityLocation property (MyInfo),
350
CommunityName property (MyInfo),
350
CommunityPopulation property
(MyInfo), 350
CommunityWords property (MyInfo),
350
CompanyAddress property (MyInfo),
350
CompanyDepartment property
(MyInfo), 350
CompanyName property (MyInfo), 350
CompanyPhone property (MyInfo), 350
CompanyWords property (MyInfo), 350
configuring ASP on IIS, 382–387
Connection object, 165–167
closing, 211–212
Errors collection, 206
Recordset objects and, 170
selecting for Recordset or Command,
176–177
connection, checking, 95
connections to database servers,
165–167
opening, 224–225
timeouts (wait lengths), 187–188
(see also database servers)
ConnectionString property
(Connection), 165, 185–187
ConnectionTimeout property
(Connection), 165, 187–188
Content Linking component, 286–302
example, 299–302
instantiating, 288
methods reference, 290–298
Content Linking list file, 287
counting entries in, 290
description of item in, 292, 294, 296
position in, 291
retrieving URL from, 293, 295, 297
Content Rotator component, 303–308
content schedule file, 304–305
instantiating, 306
methods reference, 306–308
content schedule file, 304–305
content, dynamic, 3–6
ASP (see ASP)
CGI applications, 3
code page for, 125
ISAPI, 4–6
Index 393
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
JavaScript and VBScript, 12–14, 22
locale for, 126–127
page counters, 354–357
table of contents (example), 289
user information (see Session object)
content, static, 3
HTML, 12
CONTENT_LENGTH element
(ServerVariables), 79
CONTENT_LENGTH environment
variable, 372, 374
CONTENT_TYPE element
(ServerVariables), 79
CONTENT_TYPE environment variable,
372, 374
ContentBase property
Attachment collection, 262
Message object, 264
NewMail object, 266, 272
ContentID property
Attachment collection, 262
Message object, 264
ContentLocation property
Attachment collection, 262
Message object, 264
NewMail object, 266, 274
Contents collection
Application object, 133
Session object, 129–134
Contents collection (Application), 30–34
Content-Type header, 91
ContentType property (Response), 92
Controt.DLL library, 304
cookie dictionary, 66
Cookie: header, 65
cookies, 63–68, 99–103, 122
expiration dates, 64, 100
session identifiers, 123, 127
Cookies collection (Response), 99–103
Cookies collection (Request), 65–68
Copy method
File object, 320, 335
Folder object, 323, 335
CopyFile method (FileSystemObject),
321
CopyFolder method (FileSystemObject),
321, 335
copying
files and folders, 335–336
recordsets, 209–211
Count property
Attachments collection, 263
Contents collection, 31
Contents collection (Session), 130
Cookies collection (Request), 66
Cookies collection (Response), 100
Drives collection, 319
Files collection, 320
Folders collection, 323
Form collection, 69
Messages collection, 265
QueryString collection, 74, 76
Recipients collection, 267
ServerVariables collection, 77
StaticObjects collection (Application),
35
StaticObjects collection (Session), 134
counters, 309–315
page counters, 354–357
Counters component, 309–315
instantiating, 310
methods reference, 312–315
Counters.DLL library, 310
Counters.TXT file, 310
counting records in recordsets, 201–203
CreateFolder method
(FileSystemObject), 321, 336
CreateObject method (Server), 11, 23,
116–118
StaticObjects collection and, 36, 136
(see also instantiating)
CreateParameter method (Connection),
165
CreateTextFile method
FileSystemObject object, 321
Folder object, 323
CursorLocation property
Connection object, 166
Recordset object, 171
cursors
determining type of, 188–190
opening into data source, 226–228
CursorType property (Recordset), 171,
188–190
Custom Errors tab (MMC), 385
custom library packages, 43
customized named strings, 346–353
394 Index
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
D
DAO (Data Access Objects), 160
Data Access Objects (DAO), 160
database commands
executing, 215–219
manipulating with Command object,
163–165
maximum records retrieved, 196–198
parameters, 169
reexecuting queries, 228–229
text of, 179–181
type of, 183–185
database servers
closing, 211–212
connections to, 165–167
information for establishing,
185–187
opening, 224–225
timeouts (wait lengths), 187–188
custom properties of, 170
errors, 167
application or object source,
203–204
code numbers for, 200–201
descriptions of, 190–191
saving recordset changes, 233–235
selecting connection, 176–177
DateCreated property, 319, 322, 329
DateLastAccessed property
File object, 319
Folder object, 322
DateLastModified property
File object, 320
Folder object, 322
debugging
Response object for, 86
DefaultDatabase property (Connection),
166
DefinedSize property (Field), 168
Delete method
Attachment object, 262
Attachments collection, 263
File object, 320, 337
Folder object, 323, 337
Message object, 265
Messages collection, 265
Recipient object, 267
Recipients collection, 268
Delete method (Recordset), 173,
212–214
DeleteFile method (FileSystemObject),
321
DeleteFolder method
(FileSystemObject), 321
deleting
counters, 314
files and folders, 337
recordsets, 212–214
Denali, 6
description
Content Linking list item, 292, 294,
296
Description property (Error), 167,
190–191
descriptions of database server errors,
190–191
dictionary, cookie, 66, 99
digital certificates
client certificate field access, 59–63
information in HTTP requests, 78–79
issuer information, 60, 79
Direction property (Parameter), 169
directory notation, MS-DOS, 119
Directory Security tab (MMC), 384
disk space on drives, 328
DLLs with ISAPI, 5
Document Summary component, 317
DOCUMENT_ROOT environment
variable, 372
Documents tab (MMC), 384
Domain attribute
Cookies collection (Response), 100
domain attribute (Set-Cookie header),
64
domains
cookies, comparing domain
attributes, 64
Drive object, 317–319
Drive property, 320, 322, 329
DriveExists method (FileSystemObject),
321
DriveLetter property (Drive), 318
drives, 317–319
disk space remaining, 328
format type, 330
for particular file system objects, 329
Drives collection, 319
Index 395
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
Drives property (FileSystemObject), 321
DriveType property (Drive), 318
duplicating recordsets, 209–211
dynamic content, 3–6
ASP (see ASP)
CGI applications, 3
code page for, 125
Content Rotator component, 303–308
ISAPI, 4–6
JavaScript and VBScript, 12–14, 22
locale for, 126–127
page counters, 354–357
table of contents (example), 289
user information (see Session object)
dynamic link libraries (DLLs) with
ISAPI, 5
E
ECMAScript language, 13
EditMode property (Recordset), 171
ENABLESESSIONSTATE directive, 143
encoding
query strings for URLs, 120
encoding HTMLs for display, 118
ENCTYPE parameter, 79
End method (Response), 109
environment variables
converting CGI to ASP, 372–376
environment variables for web servers,
10, 76–82
EOF property (Recordset), 172, 192–193
Error object (ADO), 167
errors
Clear method for sending, 109
database servers, 167
application or object source,
203–204
code numbers for, 200–201
descriptions of, 190–191
HTTP status codes for, 98
include files for handing, 148–149
reporting with type libraries, 155
response buffers and, 88
type library declarations, 156
(see also comments and
troubleshooting)
Errors collection (Connection), 166, 206
events
Application object, 10, 38–40
creating objects in, 117
ObjectContext object, 42, 45–47
Session object, 138–140
creating objects in, 117
Execute method
Command object, 215–217
database command type, 183
Connection object, 165, 166, 217–219
executing
database commands, 215–219
queries again, 228–229
expires attribute (Set-Cookie header),
64
Expires property
Cookies collection (Response), 100
Response object, 93
ExpiresAbsolute property (Response),
94
expiring
cached web page data, 93–95
cookies, 64, 100
digital certificates, 61
response buffering, 88
rotated advertisements, 238–239
rotated content, 304–305
script processing on server, 115
user session-level variables, 124
user sessions (inactive), 128
waiting for database command
execution, 181–183
F
Field object (ADO), 168
Fields collection (Recordset), 173
fields, record, 168
refreshing all in recordset, 230–231
File Access components, 316–345
file system object model, 317–324
methods reference, 334–345
properties reference, 324–334
File object, 319
FileExists method (FileSystemObject),
321
files
attaching to messages (CDO),
262–263, 280–283
396 Index
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
attributes of, 326–328
copying, 335–336
date created, 329
deleting, 337
determining if at end, 324–326
Document Summary component, 317
file system object model, 317–324
inserting into scripts/content,
147–150
manipulating from applications,
316–345
moving, 340
names of, 337
opening/closing, 334, 341–343
reading from/writing to, 343–345
Files collection (Folder), 320, 323
FileSystem property (Drive), 318, 330
FileSystemObject object, 316, 320–322
instantiating, 316
Filter property (Recordset), 172,
193–196
Flags value (Key property), 60
Flush method (Response), 110
Response.Buffer property and, 88–89
Folder object, 263, 322–323
FolderExists method
(FileSystemObject), 321
folders, 322–323
attributes of, 326–328
copying, 335–336
creating new, 336
date created, 329
deleting, 337
determining if root, 332
moving, 340
names of, 338
parent folders, 333
Folders collection (Folder), 323
For Each construct
iterating Contents collection, 32
For...Next construct
iterating Contents collection, 32
Form collection (Request), 56, 68–73
form submissions, 53
<FORM> tags, 53
ACTION attribute, 71
format
message data (CDO), 270, 276
physical drives, 330
forms, 68–73
converting from CGI to ASP, 365–376
frames for advertising graphics, 243
FreeSpace property (Drive), 318
From property (NewMail), 266, 274
functions, ASP, 19–22
G
GATEWAY_INTERFACE element
(ServerVariables), 79
GATEWAY_INTERFACE environment
variable, 372, 376
Get method
Counters component, 312
GET request type, 52–53
retrieving data sent with, 73–76
sending to ASP scripts, 55
GetAbsolutePathName method
(FileSystemObject), 321
GetAdvertisement method (Ad Rotator),
236, 243
GetAllContent method (Content
Rotator), 307
GetBaseName method
(FileSystemObject), 321, 337
GetChunk method (Field), 169
GetDefaultFolder method (Session), 268
GetDrive method (FileSystemObject),
321
GetDriveName method
(FileSystemObject), 321
GetExtensionName method
(FileSystemObject), 321
GetFile method (FileSystemObject), 321
GetFileName method
(FileSystemObject), 321
GetFirst method
Messages collection, 265
GetFolder method (FileSystemObject),
322
GetFolderName method
(FileSystemObject), 338
GetLast method
Messages collection, 265
GetListCount method (NextLink), 290
GetListIndex method (NextLink), 291
GetNext method
Messages collection, 265
Index 397
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
GetNextDescription method (NextLink),
292
GetNextURL method (NextLink), 293
GetNthDescription method (NextLink),
294
GetNthURL method (NextLink), 295
GetParentFolderName method
(FileSystemObject), 322
GetPrevious method
Messages collection, 265
GetPreviousDescription method
(NextLink), 296
GetPreviousURL method (NextLink),
297
GetRows method (Recordset), 173
GetSpecialFolder method
(FileSystemObject), 322, 339
GetTempName method
(FileSystemObject), 322
global variables, 10, 28–30
transactional objects and, 43, 136
GLOBAL.ASA file, 28–30, 150–156
Application object events and scope,
151–153
counter variables in, 309–315
Session object events and scope,
153–154
type library declarations, 154–156
graphics, advertising (see Ad Rotator)
Guestbook property (MyInfo), 350
H
Halcyon Software, 378
HasAccess method (Permission
Checker), 360
HasKeys attribute
Cookies collection (Response), 101
HasKeys property
Cookies collection, 66
headers, adding to messages (CDO),
279
headers, HTTP, 54
custom, adding to responses, 104
PICS system for, 96–97
requests, 50, 54
responses, 50, 54, 85
ServerVariables elements for, 77–80
User-Agent header, interpreting,
248–255
HelpContext property (Error), 167
HelpFile property (Error), 167
hit count data file, 355
hit counters, 354–357
Hits method (Page Counter), 356
HomeOccupation property (MyInfo),
350
HomePhone property (MyInfo), 350
HomeWords property (MyInfo), 350
HTML (Hypertext Markup Language),
12
CDO messages in, 270
encoding for browser display, 118
frames for advertising graphics, 243
rotating content, 303–308
<HTML> tags, server-side functions in,
21
HTMLEncode method (Server), 118
HTMLText property (Message), 264
HTTP (Hypertext Transfer Protocol),
48–57, 111–113
cookies, 63–68
example of, 48–52
form submissions, 53
headers
custom, adding to responses, 104
User-Agent header, interpreting,
248–255
request headers, 50, 54
request types, 52
requests, 10, 57–84
reading bytes from, 82–84
redirecting, 111
Request object and, 55–57
size of request body, 58
(see also Request object)
response headers, 50, 54
responses, 10, 85–113
buffering, 87–90, 108, 109–111
character sets for, 91
headers, 85
writing, 106–108
ServerVariables elements for headers,
77–80
status codes, 98
HTTP Headers tab (MMC), 384
398 Index
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
HTTP_... elements (ServerVariables), 80
HTTP_ACCEPT environment variable,
373, 374
HTTP_COOKIE environment variable,
373
HTTP_FROM environment variable,
373, 375
HTTP_QUERYSTRING parameter, 76
HTTP_REFERER environment variable,
373, 375
HTTP_USER_AGENT environment
variable, 373
HTTP_USER-AGENT environment
variable, 373
HTTPS element (ServerVariables), 80
HTTPS_KEYSIZE element
(ServerVariables), 80
HTTPS_SECRETKEYSIZE element
(ServerVariables), 80
HTTPS_SERVER_ISSUER element
(ServerVariables), 80
HTTPS_SERVER_SUBJECT element
(ServerVariables), 80
I
IIS (Internet Information Server), 4
configuring ASP on, 382–387
IIS metabase, 78, 80, 383–387
images, advertising (see Ad Rotator)
immediate-update mode, 208
deleting recordsets, 214
Importance property
Message object, 264
NewMail object, 266, 275
Inbox folder, 263
adding messages to, 265
InBox property (Session), 268
.INC file extension, 146
#include directive, 147–150
Increment method (Counters), 313
initializing
Application object, 27
application-level variables, 31
initiating user sessions, 123
<INPUT> tags
NAME= attribute, 53
inserting files into scripts/content,
147–150
INSTANCE_ID element
(ServerVariables), 80
INSTANCE_META_PATH element
(ServerVariables), 80
Instant ASP (I-ASP), 378
instantiating
Ad Rotator component, 240
ADO, 161–162
Browser Capabilities component, 253
Collaboration Data Objects, 257
Content Linking component, 288
Content Rotator component, 306
Counter component, 310
FileSystemObject object, 316
Page Counter component, 355
Permission Checker component, 359
Internet
static content, 3
Internet Information Server (IIS), 4
Internet Server API (ISAPI), 4–6
IP address
server accepting requests, 81
server making requests, 81
ISAPI DLL, metabase-specific path for,
78
ISAPI filters, 5
ISAPI technology, 4–6
IsClientConnected property (Response),
95
IsolationLevel property (Connection),
166
IsReady property (Drive), 318, 331
IsRootFolder property (Folder), 322,
332
Issuer value (Key property), 60
issuer, certificate (see digital
certificates)
Item property
Attachments collection, 263
ClientCertificate collection, 59
Contents collection, 30
Contents collection (Session), 129
Cookies collection (Request), 65
Cookies collection (Response), 99
Drives collection, 319
Files collection, 320
Folders collection, 323
Form collection, 68
Messages collection, 265
Index 399
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
QueryString collection, 74
Recipients collection, 267
ServerVariables collection, 76
StaticObjects collection (Application),
34
StaticObjects collection (Session), 134
ITU Recommendation X.509, 59, 62
J
Java, ASP for, 378
JavaScript language, 12–14, 22
K
Keep-Alive header
buffering response content, 88
Key property
ClientCertificate collection, 59
Contents collection, 31
Contents collection (Session), 129
Cookies collection (Request), 66
Cookies collection (Response), 99
Form collection, 69
QueryString collection, 74
ServerVariables collection, 77
StaticObjects collection (Application),
35
StaticObjects collection (Session), 134
L
LANGUAGE attribute (<SCRIPT>), 14
LANGUAGE directive, 143
@LANGUAGE preprocessor, 22
LCID directive, 144
LCID property (Session), 126–127, 145
library packages, custom, 43
line feed, writing, 112
Line property (TextStream), 324
LiveScript language, 12–14
LOCAL_ADDR element
(ServerVariables), 81
locale, 126–127
of message sender, 284
setting identifier for, 144
Lock method (Application), 36–38
locking/unlocking
Application object, 36–38
LockType property (Recordset), 172
logging
web site activity, 105
when sessions start/end, 138, 140
Logoff method (Session), 268
LOGON_USER element (Request), 125
LOGON_USER element
(ServerVariables), 81
LOGON_USER environment variable,
373, 374
LogonSMTP method (Session), 268
M
Macintosh character sets, 92
MailFormat property (NewMail), 266,
276
Management Console (MMC), 382–387
MapPath method (Server), 119, 139
MarshalOptions property (Recordset),
172
MaxRecords property (Recordset), 172,
196–198
memory
Recordset and Connection objects
(ADO), 170
user sessions
releasing, 136–138
Timeout property and, 129
Message object, 264
MessageFormat property
Message object, 264
Session object, 268
Messages collection (Folder), 264, 265
Messages property (Folder), 263
Messages property (MyInfo), 351
messaging with CDO
attachments to messages, 262–263,
280–283
carbon copies, 268, 271
custom headers, 279
generating messages from
applications, 265–267
message actions (reference),
280–285
message properties (reference),
268–280
Inbox and Outbox folders, 263
message data, 264, 269
400 Index
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
message data format, 270, 276
priority of messages, 275
recipient information, 267, 278
sender information, 261, 274, 284
sending messages, 283
subject of messages, 277
URLs as attachments, 281–283
URLs referenced in messages,
272–274
metabase, IIS, 78, 80, 383–387
METHOD attribute (<FORM>), 53
methods of ADO objects
reference for, 207–235
Microsoft Transaction Server, 41
(see also ObjectContext object)
MIME type, 79
MMC (Management Console), 382–387
Mode property (Connection), 166
Move method
File object, 320
Folder object, 323
Move method (Recordset), 173,
219–221
MoveFile method (FileSystemObject),
322
MoveFirst method (Recordset), 173,
221–222
MoveFolder method (FileSystemObject),
322, 340
MoveLast method (Recordset), 173,
221–222
MoveNext method (Recordset), 173,
221–222
MovePrevious method (Recordset), 173,
221–222
moving
files and folders, 340
record pointer in recordsets, 219–222
msado15.dll file, 161
MS-DOS relative directory notation, 119
MTS (Microsoft Transaction Server), 41
(see also ObjectContext object)
multithreading (see threading)
MyInfo component, 346–353
properties reference, 350–353
myinfo.dll library, 346
myinfo.xml library, 346
N
Name property, 198–200
CDO objects
AddressEntry object, 261
Attachment object, 262
Folder object, 263
Session object, 268
Connection object, 164
Field object, 168
File object, 320
Folder object, 322
Parameter object, 169
Property object, 170
Recipient object, 267
NAME= attribute (<INPUT>), 53
names
ADO objects, 198–200
files and folders, 337–339
NativeError property (Error), 167
NewMail object, 260, 265–267
methods reference, 280–285
properties reference, 268–280
NextLink object, 286–302
example, 299–302
instantiating, 288
methods reference, 290–298
Nextlink.DLL library, 287
NextRecordset method (Recordset),
173, 222–224
Number property (Error), 167, 200–201
NumericScale property
Field object, 168
Parameter object, 169
O
object model
file system, 317–324
<OBJECT> tags
application-level objects added with,
34
session-level objects added with,
134–136
ObjectContext object, 10, 41–47
application-level scope and, 33
method and event reference, 43–47
object scope and, 43, 136
objects
ADO object model, 163–173
Index 401
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
ASP object model, 9–11
CDO object model, 259–268
instantiating, 117
scope (see scope)
OLE DB, 159
OnEnd event
Application object, 10, 38
Session object, 138–139
OnStart event
Application object, 10, 39
locking/unlocking Application
object, 38
calling CreateObject in, 117
GLOBAL.ASA file, 150–156
Session object, 139–140
OnStop event
GLOBAL.ASA file, 150–156
OnTransactionAbort event
(ObjectContext), 42, 45
OnTransactionCommit event
(ObjectContext), 42, 46
Open method
Connection object, 166, 224–225
Recordset object, 173, 226–228
Open Source ASP environment,
379–381
OpenASP, 379–381
OpenAsTextStream method (File), 320,
341–343
opening
database server connections, 224–225
recordsets, 226–228
text files, 341–343
OpenSchema method (Connection),
167
OpenTextFile method
(FileSystemObject), 322
OrganizationAddress property (MyInfo),
351
OrganizationName property (MyInfo),
351
OrganizationPhone property (MyInfo),
351
OrganizationWords property (MyInfo),
351
OriginalValue property (Field), 168
Outbox folder, 263
OutBox property (Session), 268
P
Page Counter component, 354–357
instantiating, 355
methods reference, 356–357
pagecnt.dll library, 355
PageCount property (Recordset), 172
page-level scope
creating objects with, 117
PageSize property (Recordset), 172
PageType property (MyInfo), 351
Parameter object (ADO), 169
Parameters collection (Connection), 165
parameters, database commands, 169
Parent property (CDO), 259, 261
ParentFolder object (Folder), 333
ParentFolder property
File object, 320
Folder object, 322
password for authentication, 78
path attribute (Set-Cookie header), 64
Path property
Cookies collection (Response), 101
Drive object, 318
File object, 320
Folder object, 322
PATH_INFO element (ServerVariables),
81, 120
PATH_INFO environment variable, 373
PATH_TRANSLATED element
(ServerVariables), 81
PATH_TRANSLATED environment
variable, 373
paths
determining for web pages, 81
determining with MapPath( ), 119
performance
ISAPI vs. CGI applications, 5
Perl CGI script, 367
permchk.dll library, 359
Permission Checker
HasAccess method, 360
Permission Checker component,
358–361
PersonalAddress property (MyInfo), 351
PersonalMail property (MyInfo), 351
PersonalName property (MyInfo), 351
PersonalPhone property (MyInfo), 351
PersonalWords property (MyInfo), 351
402 Index
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
physical drives, 317–319
disk space remaining, 328
format type, 330
for particular file system objects, 329
PICS property (Response), 96–97
PICS rating system, 96–97
“please wait” pages, 89
pooling library packages, 43
port, web server, 81
position in Content Linking list, 291
position in recordset, 174–176
POST request type, 52–53
sending to ASP scripts, 56
Precision property
Field object, 168
Parameter object, 169
Prepared property (Connection), 164
preprocessing directives, 141–146
priority, message, 275
Properties collection
Connection object, 165, 166
Field object, 168
Parameter object, 169
Recordset object, 173
Properties dialog (MMC), 384
properties of ADO objects
Property object for, 170
reference for, 174–206
Property object (ADO), 170
PropertyName property (Browser
Capabilities), 254
Provider property (Connection), 166
proxy servers
caching web pages, 90
Q
queries (see database commands)
query strings, encoding, 120
QUERY_STRING element
(ServerVariables), 81
QUERY_STRING environment variable,
373
QUERY_STRING1 environment
variable, 375
QueryString collection, 81
QueryString collection (Request), 56,
73–76
accessing data with ServerVariables,
76
length limit, 75
quotation marks, writing, 112
R
rating web pages, 96–97
RDO (Remote Data Objects), 160
Read method
TextStream object, 324, 343
ReadAll method (TextStream), 324
ReadFromFile method (Attachment),
262
reading text files, 343
reading from HTTP requests, 82–84
ReadLine method (TextStream), 324,
343
reason phrase, 55
recipient information (CDO), 267, 278
Recipient object, 267
Recipients collection (Message), 265,
267
Recipients property (Message), 264
record source, 205–206
RecordCount property (Recordset), 172,
201–203
records
creating new, 207–209
deleting all, 212–214
fields
refreshing, 230–231
fields of, 168
moving pointer within recordset,
219–222
resulting from queries
based on recordset position,
174–176
counting in recordset, 201–203
maximum number of, 196–198
retrieving new recordset, 222–224
viewing subset of recordset,
193–196
saving changes, 233–235
Recordset object (ADO), 170–173
recordsets, 170–173
closing, 211–212
counting records in, 201–203
Index 403
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
cursor type for creating, retrieving,
188–190
deleting, 212–214
determining if at end, 178–179,
192–193
duplicating, 209–211
feature support testing, 231–233
moving pointer within, 219–222
opening, 226–228
refreshing all record fields, 230–231
retrieving next, 222–224
returning records based on position,
174–176
saving changes, 233–235
source of records in, 205–206
update modes, 208
viewing record subset, 193–196
Redirect method (Response), 111
redirecting requests, 111
redirection file (Ad Rotator), 237, 246
reexecuting database queries, 228–229
refreshing record fields, 230–231
relative directory notation, 119
Remote Data Objects (RDO), 160
REMOTE_ADDR environment variable,
373, 376
REMOTE_ATTR element
(ServerVariables), 81
REMOTE_HOST element
(ServerVariables), 81
REMOTE_HOST environment variable,
373, 376
REMOTE_IDENT environment variable,
373
REMOTE_USER environment variable,
373
Remove method
Contents collection, 33
Counters component, 314
Requery method (Recordset), 173,
228–229
Request object, 10, 57–84
BinaryRead method, 82–84
collections reference, 59–82
HTTP requests and, 55–57
TotalBytes property, 58
request types, 52
REQUEST_METHOD element
(ServerVariables), 81
REQUEST_METHOD environment
variable, 373, 376
request-line, 54
requests, HTTP, 10, 57–84
headers, 50, 54
reading bytes from, 82–84
redirecting, 111
Request object and, 55–57
size of request body, 58
Reset method (Page Counter), 357
Response object, 10, 85–113
clearing contents, 108
Cookies collection, 99–103
methods reference, 104–113
properties reference, 87–99
responses, HTTP, 10, 85–113
buffering, 87–90, 108
sending buffer remains, 109–111
characters sets for, 91
headers, 50, 54, 85
custom, 104
writing, 106–108, 111–113
Resync method (Recordset), 173,
230–231
RollbackTrans method (Connection),
167
root folder, 332
RootFolder property (Drive), 318
rotating advertisements (see Ad Rotator
component)
rotating HTML content, 303–308
rotator schedule file (Ad Rotator),
238–239, 245
RUNAT attribute (<SCRIPT>), 20
S
SafeArray variant, 82
saving recordset changes, 233–235
SchoolAddress property (MyInfo), 351
SchoolDepartment property (MyInfo),
351
SchoolName property (MyInfo), 351
SchoolPhone property (MyInfo), 351
SchoolWords property (MyInfo), 351
scope
application-level, 10, 28–30, 34
creating objects with CreateObject,
117
404 Index
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
session-level, 123–125, 134–136
site-level counter variables, 309–315
transactional objects, 43, 136
user-specific information, 123
SCOPE parameter, 117
<SCRIPT> tags, 13–14
SCRIPT_NAME element
(ServerVariables), 81
SCRIPT_NAME environment variable,
373, 374, 375
scripting languages, 12–14, 22
setting default for processing, 143
ScriptTimeout property (Server), 115
Scrrun.DLL library, 316
secure attribute (Set-Cookie header), 64
Secure property
Cookies collection (Response), 101
security
cookie information, 64, 101
identifying secure ports, 82
Permission Checker component,
358–361
Send method
Message object, 265
NewMail object, 267, 283
sender information (CDO), 261, 274,
284
Sender property (Message), 264
sending messages (CDO), 283
SerialNumber property (Drive), 318
SerialNumber value (Key property), 61
Server object, 11, 114–121
methods reference, 116–121
ScriptTimeout property, 115
SERVER_NAME element
(ServerVariables), 81
SERVER_NAME environment variable,
374, 376
SERVER_PORT element
(ServerVariables), 81
SERVER_PORT environment variable,
374, 376
SERVER_PORT_SECURE element
(ServerVariables), 82
SERVER_PROTOCOL element
(ServerVariables), 82
SERVER_PROTOCOL environment
variable, 374, 376
SERVER_SOFTWARE element
(ServerVariables), 82
SERVER_SOFTWARE environment
variable, 374, 376
servers (see web servers)
servers, database (see ADO; database
servers)
server-side functions, 19–22
server-side includes, 146–150
server-side scripting, 15–19
ServerVariables collection (Request), 10,
76–82
accessing QueryString collection
data, 76
Session object, 11, 122–140
Abandon method, 136–138
collections reference, 129–136
OnStart and OnEnd events, 138–140
GLOBAL.ASA file for, 150, 153–154
properties reference, 125–129
Session object (CDO), 268
Session property (CDO), 259, 261
SessionID property (Session), 123,
127–128
session-level scope, 123–125
corresponding type libraries, 155
creating objects with, 117
objects added with <OBJECT>,
134–136
transactional objects and, 43, 136
user-specific information, 123
sessions
counter variables and, 309
sessions (see user sessions)
Set method
Counters component, 314
SetAbort method (ObjectContext), 42,
43
SetComplete method (ObjectContext),
42, 45
Set-Cookie header, 63, 99, 103
SetLocaleIDs method
NewMail object, 267, 284
Session object, 268
ShareName property (Drive), 319
ShortName property
File object, 320
Folder object, 322
Index 405
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
ShortPath property
File object, 320
Folder object, 323
size
HTTP request body, 58
HTTP requests, 79
QueryString collection length limit,
75
Size property
File object, 320
Folder object, 323
Size property (Message), 264
Size property (Parameter), 169
Skip method (TextStream), 324
SkipLine method (TextStream), 324
Source property
Attachment object (CDO), 262
Error object, 167, 203–204
Recordset object, 172, 205–206
SQL statements (see database
commands)
SQLState property (Error), 167
SSI (server-side includes), 146–150
State property
Connection object, 164, 166
Recordset object, 172
static content, 3
HTML, 12
StaticObjects collection
Application object, 34–36
CreateObject method and, 36, 136
Session object, 134–136
status code, 55
Status property (Recordset), 172
Status property (Response), 98
status-line, 55
stored procedures (see database
commands)
storing
user information, 143
strings, named, 346–353
Style property (MyInfo), 351
SubFolders property (Folder), 323
Subject property
Message object, 264
NewMail object, 266, 277
Subject value (Key property), 61
subject, message (CDO), 277
Sun Solaris, ASP on, 377
Supports method (Recordset), 173,
231–233
System folder, 339
T
TargetFrame property (Ad Rotator), 243
TCP/IP address for web servers, 81
Temp folder, 339
text
custom named strings, 346–353
files (see files)
text files (see files)
text of database commands, 179–181
Text property (Message), 264
TextStream object, 324
closing, 334
opening, 341–343
reading from/writing to, 343–345
threading
application-level scope and, 33
Timeout property (Session), 128
timeouts
database command execution,
181–183
database server connections, 187–188
TimeReceived property (Message), 264
TimeSent property (Message), 264
Title property (MyInfo), 352
To property (NewMail), 266, 278
TotalBytes property (Request), 58
TotalSize property (Drive), 319
TRANSACTION directive, 42, 145
transactional scripts, 10, 41–47, 145
transactions
object scope and, 43, 136
troubleshooting (see comments and
troubleshooting)
type library declarations, 154–156
type of database command, 183–185
Type property
CDO objects
AddressEntry object, 261
Attachment object, 262
Field object, 168
File object, 320
Parameter object, 169
Property object, 170
Recipient object, 267
406 Index
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
U
Unlock method (Application), 38
unlocking (see locking/unlocking)
unrecognized certificate issuers, 60
Update method (Recordset), 173,
233–235
update modes for recordsets, 208
deleting recordsets, 214
UpdateBatch method (Recordset), 173
URL element (ServerVariables), 82
URL property (MyInfo), 352
URLEncode method (Server), 120
URLs
for advertising graphics, 242
attaching to messages, 281–283
Content Linking component, 286–302
retrieving from list, 293, 295, 297
cookies (see cookies)
encoding query strings, 120
redirecting requests to, 111
referenced in messages, 272–274
saving as named strings, 353
URLWords property (MyInfo), 352
user account information, 81
user sessions, 11, 122–140
enabling user information storage,
143
maintaining inactive, 128
memory for
releasing, 136–138
Timeout property and, 129
session identifiers, 123, 127–128
User-Agent header, interpreting,
248–255
users
information on, 123, 125
enabling storage of, 143
V
ValidFrom value (Key property), 61
ValidUntil value (Key property), 61
Value property
Field object, 168
NewMail object, 266, 279
Parameter object, 169
Property object, 170
variables
counter variables, 309–315
scope (see scope)
user-specific, expiring, 124
web server environment, 10, 76–82
VBScript language, 13–14, 22
Version property
NewMail object, 266, 280
Session object (CDO), 268
Version property (Connection), 166
Virtual Directory tab (MMC), 384
virtual paths
determining for web pages, 81
determining with MapPath( ), 119
Visual Basic CGI application, 368–370
VolumeName property (Drive), 319
vote tallies with counters, 311
W
waiting (see expiring; timeouts)
web browsers
Browser Capabilities component, 23,
248–255
CGI applications, 3
encoding HTML for, 118
errors, HTTP status codes for, 98
HTTP interaction, example, 48–52
messaging (see messaging with
CDO)
web pages
buffering downloads, 87–90, 108
sending buffer remains, 109–111
caching, 90
expiring cached data, 93–95
Content Linking component, 286–302
example, 299–302
counter variables for, 309–315
determining paths for, 81
hit counters for, 356
locale-specific formatting, 126–127
logging site activity, 105
“please wait” pages, 89
rating (PICS system), 96–97
scope of (see page-level scope)
web servers, 11, 114–121
ASP demonstration (example), 6–9
caching
expiring cache, 93–95
caching web pages, 90
checking connection to, 95
counter variables and, 309
Index 407
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 O’Reilly & Associates, Inc. All rights reserved.
environment variables for, 10, 76–82
errors, HTTP status codes for, 98
executing code (see server-side
scripting)
HTTP interaction, example, 48–52
ISAPI technology, 4–6
logging site activity, 105
messaging (see messaging with
CDO)
paths on (see paths)
sessions on (see user sessions)
special folders on, 339
TCP/IP address for, 81
type library declaration errors, 156
WinCGI (see CGI applications)
Windows folder, 339
Windows NT
CDO for (see CDO for NTS)
Challenge Response authentication,
358, 360
Windows Scripting Host (WSH), 383
WinNT folder, 339
Write method
Response object, 16, 111–113
TextStream object, 324, 344
WriteBlankLines method (TextStream),
324
WriteLine method (TextStream), 324
WriteToFile method (Attachment), 262
writing
HTTP responses, 111–113
response content, 106–108
to text files, 344–345
WSH (Windows Scripting Host), 383
X
X.509 Recommendation, 59, 62
XA protocol, 41

About the Author
Keyton Weissinger is a technical manager with USWeb/CKS in Atlanta, Georgia.
Before that, he worked for Arthur Andersen as the senior engineer for the Business
Consulting KnowledgeSpace.
Colophon
The animal appearing on the cover of ASP in a Nutshell is an asp, which is a term
applied to various venomous snakes, including the depicted asp viper (Vipera aspis)
of Europe as well as the Egyptian cobra (Naja haje), thought to have been the means
of Cleopatra’s suicide.
Needing to eat at least 5–6% of their body weight in food per week, European asp
vipers hunt by lying in wait for approaching prey. After grabbing and biting a small
rodent or other prey, they release it and wait several minutes for it to stop moving;
the generally sluggish viper rarely chases prey. Vipers know their home territory very
well, which allows quick escape from their asp-kicking natural enemies, serpent
eagles and hedgehogs. This trick hasn’t helped them escape from their greatest
threat, the expansion of human civilization, which frequently wipes out large sections
of their territory.
The chemical composition of asp viper venom can vary from one population to the
next, hampering initial antivenin development until 1896, but few viper bite fatalities
occur in Europe today.
Clairemarie Fisher O’Leary was the production editor for ASP in a Nutshell. Sheryl
Avruch was the production manager; Jeff Liggett, Norma Emory, and John Files provided
production support and quality assurance. Mike Sierra provided tools support.
Seth Maislin wrote the index.
Edie Freedman designed the cover of this book using a 19th-century engraving from
the Dover Pictorial Archive. The cover layout was produced with QuarkXPress 3.32
using the ITC Garamond font.
The inside layout was designed by Nancy Priest and implemented in FrameMaker
by Mike Sierra. The text and heading fonts are ITC Garamond Light and Garamond
Book. The illustrations that appear in the book were created in Macromedia Freehand
7.0 and screen shots were created in Adobe Photoshop 4.0 by Robert Romano
or Rhon Porter. This colophon was written by Nancy Kotary.
The production editors for ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
were Ellie Cutler and Jeff Liggett. Linda Walsh was the product manager.
Kathleen Wilson provided design support. Lenny Muellner, Mike Sierra, Erik Ray,
and Benn Salter provided technical