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!Softs Chili!ASP product is the most evolved alternative environment
available
for running your ASP applications. It is a functional and syntactic equivalent
of
Microsofts 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 OReilly & Associates, Inc. All rights
reserved.
Comments
Chili!Softs 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!Softs 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 Softwares 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!Softs 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 OReilly & 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 projects 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 OReilly & Associates, Inc. All rights
reserved.
Comments
Like many authors at OReilly, Im a big supporter of additions
to the free software
arena. Im 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: OpenASPs 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 OReilly & 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: OpenASPs Support for ASP Functionality (continued)
Feature Supported
382
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 OReilly & 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
Microsofts 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.
Microsofts 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 servers
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 OReilly & 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 servers
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 OReilly & 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, lets
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 OReilly & 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 OReilly & 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 OReilly & 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 OReilly & Associates, Inc. All rights
reserved.
Index
. and .. for directories, 119
<%
%> delimiters, 15
<%@ ... %> directive syntax, 141
<%=
%> delimiters, 1619
A
Abandon method (Session), 136138
aborting transactions, 42, 43
AbsolutePage property (Recordset), 171
AbsolutePosition property (Recordset),
171, 174176
Access component, 316345
file system object model, 317324
methods reference, 334345
properties reference, 324334
ACTION attribute (<FORM>), 71
Active Messaging (see CDO for NTS)
ActiveConnection property, 176177
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, 236247
example of using, 244247
GetAdvertisement method, 236, 243
instantiating, 240
properties reference, 241243
required files, 237
rotator schedule file, 238239, 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,
207209
Address property
AddressEntry object, 261
Recipient object, 267
AddressEntry object, 261
ADO (ActiveX Data Objects), 159235
application-level objects to maintain
connections, 29
DLLs required for, 161
Errors collection (Connection), 206
instantiating, 161162
methods reference, 207235
object model, 163173
properties reference, 174206
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 OReilly & 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, 2740
collections reference, 3036
methods reference, 3638
OnStart and OnEnd events, 10, 3840
GLOBAL.ASA file for, 150, 151153
Application property (CDO), 259, 260
application-level scope, 10, 2830
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,
316345
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, 382387
converting CGI to, 365376
functions, 1922
introduction and demonstration, 69
non-Microsoft platforms, 377381
object model, 911
scripts calling themselves, 7173
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, 262263,
280283
AttachURL method (NewMail), 267,
281283
Attributes property, 319, 322, 326328
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), 8284
BinaryWrite method (Response),
106108
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 OReilly & Associates, Inc. All rights
reserved.
BodyFormat property (NewMail), 266,
270
BOF property (Recordset), 171, 178179
Bookmark property (Recordset), 171
Border property (Ad Rotator), 241
borders around advertisement graphics,
241
BrowsCap.dll library, 249
BrowsCap.ini file, 249253
Browser Capabilities component, 23,
248255
instantiating, 253
PropertyName property, 254
required files, 249253
browsers (see web browsers)
BrowserType object, creating, 248255
Buffer property (Response), 8790
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, 9395
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, 256285
instantiating CDOs, 257
object model, 259268
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,
365376
environment variables, 372376
version used by web server, 79
CGI_ variables (WinCGI), 374376
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),
5963, 78
ClientCustomHeader header, 104
client-side scripting, 1214
as dynamic script output, 16
Clone method (Recordset), 173,
209211
Close method, 211212
Connection object, 166
Recordset object, 173
TextStream object, 324, 334
closing
text files, 334
data servers or recordsets, 211212
code reuse, 1922
CODEPAGE directive, 126, 142
392 Index
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 OReilly & Associates, Inc. All rights
reserved.
CodePage property (Session), 125126,
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, 155156
Command object (ADO), 163165
commands, database (see database
commands)
CommandText property
Command object, 179181
Connection object, 164
CommandTimeout property, 164, 165,
181183
CommandType property
Command object, 183185
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, 2830
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, 123125
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, 382387
Connection object, 165167
closing, 211212
Errors collection, 206
Recordset objects and, 170
selecting for Recordset or Command,
176177
connection, checking, 95
connections to database servers,
165167
opening, 224225
timeouts (wait lengths), 187188
(see also database servers)
ConnectionString property
(Connection), 165, 185187
ConnectionTimeout property
(Connection), 165, 187188
Content Linking component, 286302
example, 299302
instantiating, 288
methods reference, 290298
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, 303308
content schedule file, 304305
instantiating, 306
methods reference, 306308
content schedule file, 304305
content, dynamic, 36
ASP (see ASP)
CGI applications, 3
code page for, 125
ISAPI, 46
Index 393
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 OReilly & Associates, Inc. All rights
reserved.
JavaScript and VBScript, 1214, 22
locale for, 126127
page counters, 354357
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, 129134
Contents collection (Application), 3034
Content-Type header, 91
ContentType property (Response), 92
Controt.DLL library, 304
cookie dictionary, 66
Cookie: header, 65
cookies, 6368, 99103, 122
expiration dates, 64, 100
session identifiers, 123, 127
Cookies collection (Response), 99103
Cookies collection (Request), 6568
Copy method
File object, 320, 335
Folder object, 323, 335
CopyFile method (FileSystemObject),
321
CopyFolder method (FileSystemObject),
321, 335
copying
files and folders, 335336
recordsets, 209211
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, 309315
page counters, 354357
Counters component, 309315
instantiating, 310
methods reference, 312315
Counters.DLL library, 310
Counters.TXT file, 310
counting records in recordsets, 201203
CreateFolder method
(FileSystemObject), 321, 336
CreateObject method (Server), 11, 23,
116118
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, 188190
opening into data source, 226228
CursorType property (Recordset), 171,
188190
Custom Errors tab (MMC), 385
custom library packages, 43
customized named strings, 346353
394 Index
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 OReilly & Associates, Inc. All rights
reserved.
D
DAO (Data Access Objects), 160
Data Access Objects (DAO), 160
database commands
executing, 215219
manipulating with Command object,
163165
maximum records retrieved, 196198
parameters, 169
reexecuting queries, 228229
text of, 179181
type of, 183185
database servers
closing, 211212
connections to, 165167
information for establishing,
185187
opening, 224225
timeouts (wait lengths), 187188
custom properties of, 170
errors, 167
application or object source,
203204
code numbers for, 200201
descriptions of, 190191
saving recordset changes, 233235
selecting connection, 176177
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,
212214
DeleteFile method (FileSystemObject),
321
DeleteFolder method
(FileSystemObject), 321
deleting
counters, 314
files and folders, 337
recordsets, 212214
Denali, 6
description
Content Linking list item, 292, 294,
296
Description property (Error), 167,
190191
descriptions of database server errors,
190191
dictionary, cookie, 66, 99
digital certificates
client certificate field access, 5963
information in HTTP requests, 7879
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, 317319
Drive property, 320, 322, 329
DriveExists method (FileSystemObject),
321
DriveLetter property (Drive), 318
drives, 317319
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 OReilly & Associates, Inc. All rights
reserved.
Drives property (FileSystemObject), 321
DriveType property (Drive), 318
duplicating recordsets, 209211
dynamic content, 36
ASP (see ASP)
CGI applications, 3
code page for, 125
Content Rotator component, 303308
ISAPI, 46
JavaScript and VBScript, 1214, 22
locale for, 126127
page counters, 354357
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, 372376
environment variables for web servers,
10, 7682
EOF property (Recordset), 172, 192193
Error object (ADO), 167
errors
Clear method for sending, 109
database servers, 167
application or object source,
203204
code numbers for, 200201
descriptions of, 190191
HTTP status codes for, 98
include files for handing, 148149
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, 3840
creating objects in, 117
ObjectContext object, 42, 4547
Session object, 138140
creating objects in, 117
Execute method
Command object, 215217
database command type, 183
Connection object, 165, 166, 217219
executing
database commands, 215219
queries again, 228229
expires attribute (Set-Cookie header),
64
Expires property
Cookies collection (Response), 100
Response object, 93
ExpiresAbsolute property (Response),
94
expiring
cached web page data, 9395
cookies, 64, 100
digital certificates, 61
response buffering, 88
rotated advertisements, 238239
rotated content, 304305
script processing on server, 115
user session-level variables, 124
user sessions (inactive), 128
waiting for database command
execution, 181183
F
Field object (ADO), 168
Fields collection (Recordset), 173
fields, record, 168
refreshing all in recordset, 230231
File Access components, 316345
file system object model, 317324
methods reference, 334345
properties reference, 324334
File object, 319
FileExists method (FileSystemObject),
321
files
attaching to messages (CDO),
262263, 280283
396 Index
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 OReilly & Associates, Inc. All rights
reserved.
attributes of, 326328
copying, 335336
date created, 329
deleting, 337
determining if at end, 324326
Document Summary component, 317
file system object model, 317324
inserting into scripts/content,
147150
manipulating from applications,
316345
moving, 340
names of, 337
opening/closing, 334, 341343
reading from/writing to, 343345
Files collection (Folder), 320, 323
FileSystem property (Drive), 318, 330
FileSystemObject object, 316, 320322
instantiating, 316
Filter property (Recordset), 172,
193196
Flags value (Key property), 60
Flush method (Response), 110
Response.Buffer property and, 8889
Folder object, 263, 322323
FolderExists method
(FileSystemObject), 321
folders, 322323
attributes of, 326328
copying, 335336
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, 6873
form submissions, 53
<FORM> tags, 53
ACTION attribute, 71
format
message data (CDO), 270, 276
physical drives, 330
forms, 6873
converting from CGI to ASP, 365376
frames for advertising graphics, 243
FreeSpace property (Drive), 318
From property (NewMail), 266, 274
functions, ASP, 1922
G
GATEWAY_INTERFACE element
(ServerVariables), 79
GATEWAY_INTERFACE environment
variable, 372, 376
Get method
Counters component, 312
GET request type, 5253
retrieving data sent with, 7376
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 OReilly & 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, 2830
transactional objects and, 43, 136
GLOBAL.ASA file, 2830, 150156
Application object events and scope,
151153
counter variables in, 309315
Session object events and scope,
153154
type library declarations, 154156
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, 9697
requests, 50, 54
responses, 50, 54, 85
ServerVariables elements for, 7780
User-Agent header, interpreting,
248255
HelpContext property (Error), 167
HelpFile property (Error), 167
hit count data file, 355
hit counters, 354357
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, 303308
<HTML> tags, server-side functions in,
21
HTMLEncode method (Server), 118
HTMLText property (Message), 264
HTTP (Hypertext Transfer Protocol),
4857, 111113
cookies, 6368
example of, 4852
form submissions, 53
headers
custom, adding to responses, 104
User-Agent header, interpreting,
248255
request headers, 50, 54
request types, 52
requests, 10, 5784
reading bytes from, 8284
redirecting, 111
Request object and, 5557
size of request body, 58
(see also Request object)
response headers, 50, 54
responses, 10, 85113
buffering, 8790, 108, 109111
character sets for, 91
headers, 85
writing, 106108
ServerVariables elements for headers,
7780
status codes, 98
HTTP Headers tab (MMC), 384
398 Index
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 OReilly & 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, 382387
IIS metabase, 78, 80, 383387
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, 147150
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,
147150
INSTANCE_ID element
(ServerVariables), 80
INSTANCE_META_PATH element
(ServerVariables), 80
Instant ASP (I-ASP), 378
instantiating
Ad Rotator component, 240
ADO, 161162
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), 46
IP address
server accepting requests, 81
server making requests, 81
ISAPI DLL, metabase-specific path for,
78
ISAPI filters, 5
ISAPI technology, 46
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 OReilly & 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, 1214, 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), 126127, 145
library packages, custom, 43
line feed, writing, 112
Line property (TextStream), 324
LiveScript language, 1214
LOCAL_ADDR element
(ServerVariables), 81
locale, 126127
of message sender, 284
setting identifier for, 144
Lock method (Application), 3638
locking/unlocking
Application object, 3638
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), 382387
MapPath method (Server), 119, 139
MarshalOptions property (Recordset),
172
MaxRecords property (Recordset), 172,
196198
memory
Recordset and Connection objects
(ADO), 170
user sessions
releasing, 136138
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, 262263,
280283
carbon copies, 268, 271
custom headers, 279
generating messages from
applications, 265267
message actions (reference),
280285
message properties (reference),
268280
Inbox and Outbox folders, 263
message data, 264, 269
400 Index
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 OReilly & 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, 281283
URLs referenced in messages,
272274
metabase, IIS, 78, 80, 383387
METHOD attribute (<FORM>), 53
methods of ADO objects
reference for, 207235
Microsoft Transaction Server, 41
(see also ObjectContext object)
MIME type, 79
MMC (Management Console), 382387
Mode property (Connection), 166
Move method
File object, 320
Folder object, 323
Move method (Recordset), 173,
219221
MoveFile method (FileSystemObject),
322
MoveFirst method (Recordset), 173,
221222
MoveFolder method (FileSystemObject),
322, 340
MoveLast method (Recordset), 173,
221222
MoveNext method (Recordset), 173,
221222
MovePrevious method (Recordset), 173,
221222
moving
files and folders, 340
record pointer in recordsets, 219222
msado15.dll file, 161
MS-DOS relative directory notation, 119
MTS (Microsoft Transaction Server), 41
(see also ObjectContext object)
multithreading (see threading)
MyInfo component, 346353
properties reference, 350353
myinfo.dll library, 346
myinfo.xml library, 346
N
Name property, 198200
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, 198200
files and folders, 337339
NativeError property (Error), 167
NewMail object, 260, 265267
methods reference, 280285
properties reference, 268280
NextLink object, 286302
example, 299302
instantiating, 288
methods reference, 290298
Nextlink.DLL library, 287
NextRecordset method (Recordset),
173, 222224
Number property (Error), 167, 200201
NumericScale property
Field object, 168
Parameter object, 169
O
object model
file system, 317324
<OBJECT> tags
application-level objects added with,
34
session-level objects added with,
134136
ObjectContext object, 10, 4147
application-level scope and, 33
method and event reference, 4347
object scope and, 43, 136
objects
ADO object model, 163173
Index 401
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 OReilly & Associates, Inc. All rights
reserved.
ASP object model, 911
CDO object model, 259268
instantiating, 117
scope (see scope)
OLE DB, 159
OnEnd event
Application object, 10, 38
Session object, 138139
OnStart event
Application object, 10, 39
locking/unlocking Application
object, 38
calling CreateObject in, 117
GLOBAL.ASA file, 150156
Session object, 139140
OnStop event
GLOBAL.ASA file, 150156
OnTransactionAbort event
(ObjectContext), 42, 45
OnTransactionCommit event
(ObjectContext), 42, 46
Open method
Connection object, 166, 224225
Recordset object, 173, 226228
Open Source ASP environment,
379381
OpenASP, 379381
OpenAsTextStream method (File), 320,
341343
opening
database server connections, 224225
recordsets, 226228
text files, 341343
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, 354357
instantiating, 355
methods reference, 356357
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,
358361
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 OReilly & Associates, Inc. All rights
reserved.
physical drives, 317319
disk space remaining, 328
format type, 330
for particular file system objects, 329
PICS property (Response), 9697
PICS rating system, 9697
please wait pages, 89
pooling library packages, 43
port, web server, 81
position in Content Linking list, 291
position in recordset, 174176
POST request type, 5253
sending to ASP scripts, 56
Precision property
Field object, 168
Parameter object, 169
Prepared property (Connection), 164
preprocessing directives, 141146
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, 174206
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,
7376
accessing data with ServerVariables,
76
length limit, 75
quotation marks, writing, 112
R
rating web pages, 9697
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, 8284
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, 205206
RecordCount property (Recordset), 172,
201203
records
creating new, 207209
deleting all, 212214
fields
refreshing, 230231
fields of, 168
moving pointer within recordset,
219222
resulting from queries
based on recordset position,
174176
counting in recordset, 201203
maximum number of, 196198
retrieving new recordset, 222224
viewing subset of recordset,
193196
saving changes, 233235
Recordset object (ADO), 170173
recordsets, 170173
closing, 211212
counting records in, 201203
Index 403
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 OReilly & Associates, Inc. All rights
reserved.
cursor type for creating, retrieving,
188190
deleting, 212214
determining if at end, 178179,
192193
duplicating, 209211
feature support testing, 231233
moving pointer within, 219222
opening, 226228
refreshing all record fields, 230231
retrieving next, 222224
returning records based on position,
174176
saving changes, 233235
source of records in, 205206
update modes, 208
viewing record subset, 193196
Redirect method (Response), 111
redirecting requests, 111
redirection file (Ad Rotator), 237, 246
reexecuting database queries, 228229
refreshing record fields, 230231
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,
228229
Request object, 10, 5784
BinaryRead method, 8284
collections reference, 5982
HTTP requests and, 5557
TotalBytes property, 58
request types, 52
REQUEST_METHOD element
(ServerVariables), 81
REQUEST_METHOD environment
variable, 373, 376
request-line, 54
requests, HTTP, 10, 5784
headers, 50, 54
reading bytes from, 8284
redirecting, 111
Request object and, 5557
size of request body, 58
Reset method (Page Counter), 357
Response object, 10, 85113
clearing contents, 108
Cookies collection, 99103
methods reference, 104113
properties reference, 8799
responses, HTTP, 10, 85113
buffering, 8790, 108
sending buffer remains, 109111
characters sets for, 91
headers, 50, 54, 85
custom, 104
writing, 106108, 111113
Resync method (Recordset), 173,
230231
RollbackTrans method (Connection),
167
root folder, 332
RootFolder property (Drive), 318
rotating advertisements (see Ad Rotator
component)
rotating HTML content, 303308
rotator schedule file (Ad Rotator),
238239, 245
RUNAT attribute (<SCRIPT>), 20
S
SafeArray variant, 82
saving recordset changes, 233235
SchoolAddress property (MyInfo), 351
SchoolDepartment property (MyInfo),
351
SchoolName property (MyInfo), 351
SchoolPhone property (MyInfo), 351
SchoolWords property (MyInfo), 351
scope
application-level, 10, 2830, 34
creating objects with CreateObject,
117
404 Index
ASP in a Nutshell: A Desktop Quick Reference, eMatter Edition
Copyright © 2000 OReilly & Associates, Inc. All rights
reserved.
session-level, 123125, 134136
site-level counter variables, 309315
transactional objects, 43, 136
user-specific information, 123
SCOPE parameter, 117
<SCRIPT> tags, 1314
SCRIPT_NAME element
(ServerVariables), 81
SCRIPT_NAME environment variable,
373, 374, 375
scripting languages, 1214, 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,
358361
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, 114121
methods reference, 116121
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, 1922
server-side includes, 146150
server-side scripting, 1519
ServerVariables collection (Request), 10,
7682
accessing QueryString collection
data, 76
Session object, 11, 122140
Abandon method, 136138
collections reference, 129136
OnStart and OnEnd events, 138140
GLOBAL.ASA file for, 150, 153154
properties reference, 125129
Session object (CDO), 268
Session property (CDO), 259, 261
SessionID property (Session), 123,
127128
session-level scope, 123125
corresponding type libraries, 155
creating objects with, 117
objects added with <OBJECT>,
134136
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 OReilly & 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, 203204
Recordset object, 172, 205206
SQL statements (see database
commands)
SQLState property (Error), 167
SSI (server-side includes), 146150
State property
Connection object, 164, 166
Recordset object, 172
static content, 3
HTML, 12
StaticObjects collection
Application object, 3436
CreateObject method and, 36, 136
Session object, 134136
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, 346353
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,
231233
System folder, 339
T
TargetFrame property (Ad Rotator), 243
TCP/IP address for web servers, 81
Temp folder, 339
text
custom named strings, 346353
files (see files)
text files (see files)
text of database commands, 179181
Text property (Message), 264
TextStream object, 324
closing, 334
opening, 341343
reading from/writing to, 343345
threading
application-level scope and, 33
Timeout property (Session), 128
timeouts
database command execution,
181183
database server connections, 187188
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, 4147, 145
transactions
object scope and, 43, 136
troubleshooting (see comments and
troubleshooting)
type library declarations, 154156
type of database command, 183185
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 OReilly & Associates, Inc. All rights
reserved.
U
Unlock method (Application), 38
unlocking (see locking/unlocking)
unrecognized certificate issuers, 60
Update method (Recordset), 173,
233235
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, 281283
Content Linking component, 286302
retrieving from list, 293, 295, 297
cookies (see cookies)
encoding query strings, 120
redirecting requests to, 111
referenced in messages, 272274
saving as named strings, 353
URLWords property (MyInfo), 352
user account information, 81
user sessions, 11, 122140
enabling user information storage,
143
maintaining inactive, 128
memory for
releasing, 136138
Timeout property and, 129
session identifiers, 123, 127128
User-Agent header, interpreting,
248255
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, 309315
scope (see scope)
user-specific, expiring, 124
web server environment, 10, 7682
VBScript language, 1314, 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, 368370
VolumeName property (Drive), 319
vote tallies with counters, 311
W
waiting (see expiring; timeouts)
web browsers
Browser Capabilities component, 23,
248255
CGI applications, 3
encoding HTML for, 118
errors, HTTP status codes for, 98
HTTP interaction, example, 4852
messaging (see messaging with
CDO)
web pages
buffering downloads, 8790, 108
sending buffer remains, 109111
caching, 90
expiring cached data, 9395
Content Linking component, 286302
example, 299302
counter variables for, 309315
determining paths for, 81
hit counters for, 356
locale-specific formatting, 126127
logging site activity, 105
please wait pages, 89
rating (PICS system), 9697
scope of (see page-level scope)
web servers, 11, 114121
ASP demonstration (example), 69
caching
expiring cache, 9395
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 OReilly & Associates, Inc. All rights
reserved.
environment variables for, 10, 7682
errors, HTTP status codes for, 98
executing code (see server-side
scripting)
HTTP interaction, example, 4852
ISAPI technology, 46
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, 111113
TextStream object, 324, 344
WriteBlankLines method (TextStream),
324
WriteLine method (TextStream), 324
WriteToFile method (Attachment), 262
writing
HTTP responses, 111113
response content, 106108
to text files, 344345
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 Cleopatras suicide.
Needing to eat at least 56% 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 hasnt 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 OLeary 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
|