Uh-oh, it looks like your Internet Explorer is out of date.

For a better shopping experience, please upgrade now.

ASP in a Nutshell

ASP in a Nutshell

4.0 4
by Keyton Weissinger, Ron Petrusha (Editor)

See All Formats & Editions

ASP in a Nutshell provides the high-quality reference documentation that web application developers really need to create effective Active Server Pages. It focuses on how features are used in a real application and highlights little-known or undocumented features.This book also includes an overview of the interaction between the latest release of Internet


ASP in a Nutshell provides the high-quality reference documentation that web application developers really need to create effective Active Server Pages. It focuses on how features are used in a real application and highlights little-known or undocumented features.This book also includes an overview of the interaction between the latest release of Internet Information Server (version 5) and ASP 3.0, with an introduction to the IIS object model and the objects it comprises. The examples shown in this section and throughout the book are illustrated in VBScript.The main components of this book are:

  • Active Server Pages Introduction. Brief overview of the ASP application paradigm with examples in VBScript. Also included is an introduction to Microsoft's Internet Information Server 5.0, the IIS object model, and the objects that it comprises.
  • Object Reference. Each object is discussed in the following manner: descriptions, properties, collections, methods, events, accessory files/required DLLs, and remarks, including real-world uses, tips and tricks, and author's experience (where applicable). The objects—Application, Response, Request, Server, Session, ObjectContext, and ASPError, as well as ASP Directives, Global.ASA, and Server-Side Includes—all follow this paradigm.
  • Component Reference. This section follows the same paradigm found in Object Reference. The discussion covers all of the additional components included with IIS, such as ActiveX Data Objects, the Ad Rotator, the Browser capabilities component, the File System Object, and more.
  • Appendixes. Gives examples in one or two objects and components using Perl, REXX, and Python in ASP.
Like other books in the "In a Nutshell" series this book offers the facts, including critical background information, in a no-nonsense manner that users will refer to again and again. It is a detailed reference that enables even experienced web developers to advance their ASP applications to new levels.

Editorial Reviews

The Barnes & Noble Review
If you're an experienced developer working with ASP 3 and IIS 5.0, here's the authoritative, real-world ASP reference you'll use every day. Building on his best-selling first edition, A. Keyton Weissinger offers detailed insight for making the most of ASP 3 and the IIS object model, followed by a comprehensive reference focusing on real-world applications and illuminating underpublicized ASP features that offer you powerful opportunities.

ASP in a Nutshell, Second Edition presents detailed coverage of every key ASP object: when you'd use it, how it works, its properties, collections, methods, events, any accessory files or DLLs you'll need, and (in many cases) tricks from the author's personal grab-bag. Weissinger introduces preprocessing directives, server-side includes, GLOBAL.ASA, and much more. You'll also learn how to use the powerful components that ship with ASP 3.0 and IIS 5.0, including its ADO 2.6 support and prebuilt components for ad and content rotation, browsing, CDO-based workflow and messaging, content linking, page counters, file access, logging, permission checking, and more.

Four valuable appendices cover ASP Intrinsic Objects, conversion of CGI/WinCGI applications to ASP, ASP on alternative platforms (e.g., ChiliSoft); and configuring ASP applications on IIS.
Bill Camarda, bn.com editor

Library Journal
ASP (active server pages) technology is a model of dynamic information service, which means the user gets customized information rather than static, designed-for-everyone html pages. ASP also has an open-source initiative, which gives legs to ASP outside of Microsoft; presently it runs on everything from Microsoft to Unix/Linux, Mac, and SGI. This manual is not for beginners, but this is a highly lucrative area at the moment. Copyright 1999 Cahners Business Information.
This reference guide for developers shows how particular object model features are used in a real application, and highlights little- known or undocumented aspects. The second edition is updated to cover ASP 3.0 and IIS 5.0. Annotation c. Book News, Inc., Portland, OR (booknews.com)

Product Details

O'Reilly Media, Incorporated
Publication date:
In a Nutshell (O'Reilly) Series
Edition description:
Second Edition
Product dimensions:
6.00(w) x 9.00(h) x 1.15(d)

Read an Excerpt

Chapter 6: ObjectContext Object

As of version 2.0, an important feature of Active Server Pages is the ability to create a transactional script: one whose constituent code segments all succeed completely or fail as a group. For example, using such a script, one section of code could remove a record from an inventory table, and a second section could add a record to a sales log table. However, only if both sections of code succeed does the script itself succeed. If the removal of the inventory record or the addition of the sales record fails, the script itself fails. Both processes are rolled back: the deleted record, if it was removed, is added back into the database, and the sales record, if it was added, is removed from the sales log table. This ability to wrap several functions in a single transactional unit that succeeds or fails as a whole is an important improvement in the power of ASP applications. Previously, all transactions relied on database transaction support.

ASP application transactions are controlled by Windows 2000 COM+ Component Services or Windows NT's Microsoft Transaction Server (MTS). This piece of the BackOffice suite allows control over all database actions coded to use it. Support for transactional scripts is built into IIS and Personal Web Server and does not require any special setup. Without COM+ Component Services' or, in ASP 2.0, MTS transactional support, your applications would have to track all database changes manually and roll back all database actions by hand, keeping track of multiuser and concurrency issues, etc. MTS or COM+ Component Services gives this support for very little extra coding--as long as the database your application is connected to supports the XA protocol from the X/Open consortium. Note that this support is currently limited to SQL Server. Note, also, that this means that file actions are not yet supported--or at least, not automatically.

ASP's support of transactions is coded through the use of the ObjectContext object, which represents the actual ObjectContext object of COM+ Component Services itself. By calling methods of the ObjectContext object and coding its events, you can create a transactional script with only a few more lines of code.

To declare all the script on a given page to be transactional, simply add the following line of code as the first line in your script:

<%@ TRANSACTION = Required %>

For more details on the TRANSACTION ASP directive, see Chapter 11, Preprocessing Directives, Server-Side Includes, and GLOBAL.ASA. Here it is important only that this line be the first in your script; including this line alerts the web server to use Component Services to ensure that the script succeeds or fails as a whole.

To commit the transaction or abort it, you simply call the SetComplete or SetAbort methods of the ObjectContext object, respectively. If you are dealing with a complex transaction containing segments of code that are not supported by Component Services (notably file actions), you can specially code for these actions in the ObjectContext events OnTransactionCommit and OnTransactionAbort. There are examples of all of these methods and event procedures in the reference section later in this chapter.

ObjectContext Object Summary



There are currently two very important limitations in constructing transactional scripts:

  • Only database actions are supported, and only databases that support the XA protocol are supported by COM+ Component Services or MTS.

  • A transaction cannot span more than one ASP page. For this reason, you must be very careful in creating your pages: they must include all the actions required by your transactions but not be so large as to slow the processing of the page by too large a percentage...

Meet the Author

Weissinger is the Director for Enterprise Solutions at a start-up company in Atlanta.

Customer Reviews

Average Review:

Post to your social network


Most Helpful Customer Reviews

See all customer reviews

ASP in a Nutshell 4 out of 5 based on 0 ratings. 8 reviews.
Guest More than 1 year ago
This is truly an excellent book. I have read both editions and loved them. This is the only ASP 'classic' title that you will ever need and I can assure you from experience that the examples definitely work. The Wrox books dwell on trivial subjects ad nauseum. If you have experience with programming, you can plough through this and start writing good ASP code in no time. If you pick up VBScript in a Nutshell, you will be unstoppable in your ASP coding.
Guest More than 1 year ago
this book is good for people who already have some knowledge about asp. i wouldn't recommend it for beginners. it requires a lot of reading and there is so much text written to actually extract some meaningful iformation.
Guest More than 1 year ago
I never saw asp code before and with this book I understand and was able to make a family tree site for my family.
Guest More than 1 year ago
This is a good starting point. All you need is PWS and have some understanding of HTML with VB scripting and this will put in right path. Good examples as well. This book has been sitting on my shelves for a year. I just have been waiting for the right time to apply ASP. And in no time I was supporting DB server for our dept's web page.
Guest More than 1 year ago
If you use ASP in your development you must have this book! Excellent quick reference!
Guest More than 1 year ago
A gotta-have! In its unassuming text and its relatively handy size.ASP in a Nutshell is a great reference book, with detailed descriptions and examples of the Objects and Components of ASP
Guest More than 1 year ago
This book has been an amazing boost to my ability to use ASP and quickly turn out web apps! A gotta-have! In its unassuming text and its relatively handy size, it is a perfect companion!
Guest More than 1 year ago
I have purchased three other ASP programming books before reading this one. After reviewing the code samples in this book, I can not recommend this book be used by anyone serious about programming. The sample code does not work and the advice is either outdated or simply wrong. It is painfully obvious that this coder has very little time actually using the code.