Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

ASP Programming for the Absolute Beginner

.pdf
Скачиваний:
64
Добавлен:
17.08.2013
Размер:
7.66 Mб
Скачать

 

 

Y

 

L

 

F

 

M

 

A

 

E

 

T

 

 

ASP

Programming

®

JOHN GOSNEY

© 2002 by Premier Press, Inc. All rights reserved. No part of this book may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system without written permission from Premier Press, except for the inclusion of brief quotations in a review.

Premier Press and For the Absolute Beginner are registered trademarks of Premier Press, Inc.

Microsoft, Windows 95, Windows 98, Windows 2000, Windows NT, Internet Explorer, FrontPage, and VBScript are trademarks or registered trademarks of Microsoft Corporation.

Important: Premier Press cannot provide software support. Please contact the appropriate software manufacturer’s technical support line or Web site for assistance.

Premier Press and the author have attempted throughout this book to distinguish proprietary trademarks from descriptive terms by following the capitalization style used by the manufacturer.

Information contained in this book has been obtained by Premier Press from sources believed to be reliable. However, because of the possibility of human or mechanical error by our sources, Premier Press, or others, the Publisher does not guarantee the accuracy, adequacy, or completeness of any information and is not responsible for any errors or omissions or the results obtained from use of such information. Readers should be particularly aware of the fact that the Internet is an ever-changing entity. Some facts may have changed since this book went to press.

ISBN: 1-931841-01-2

Librar y of Congress Catalog Card Number: 2001091383

Printed in the United States of America 01 02 03 04 05 RI 10 9 8 7 6 5 4 3 2 1

Publisher:

Stacy L. Hiquet

Marketing Manager:

Heather Buzzingham

Managing Editor:

Sandy Doell

Acquisitions Editor:

Melody Layne

Project Editor:

Heather Talbot

Technical Reviewer:

Chad Beckner

Copy Editor:

Kate Talbot

Interior Layout:

Danielle Foster

Cover Design:

Mike Tanamachi

Indexer:

Katherine Stimson

Proofreader:

Jenny Davidson

To my father, Richard Gosney, for inspiring my dreams. To my mother, Marilyn Gosney, for helping me so much in achieving them. I love you both very much.

This page intentionally left blank

Acknowledgments

Ihave written several books, and I am always struck by the same thought as the writing process for each one comes to an end: that is, over the course of a few short months, life can take a fantastic array of twists and turns. Working on a project like this one provides neat bookends to a beginning and an end,

and always—without fail—forces me to pause and review the previous months of my life.

Sometimes, these periods are filled with joy, as occurred with my last project and my son being born as the book neared completion. Yet other times, life takes unexpected and traumatic turns. As I write this, my mind continues to dwell on the tragedy of September 11, 2001, and the thousands of people who have lost their lives. It has been difficult to accept the events of that day. Moreover, it has marked the ending of this particular project as indeed one of the darker bookends in my, and the world’s, lifetime.

But as with all things, healing does begin, and the pain (if not the memory) of such a tragedy is gradually lessened. As befits a computer book, the real promise of technology (that is, of making the world a better place) reminds me, as I write this, that there is still great promise in the world, and that human ingenuity, creativity, perseverance, and kindness can (and will) prevail. Technology and all the benefits it brings can help deliver this promise, and it is this thought (among many) that has gotten me through these sad and mournful days.

That said, there are many people who have worked on this book who, through their efforts, have kept this promise of technology alive and well, and have in turn helped to make this book far better than it ever could have possibly been. Once again, Emi Smith has come through with her fantastic organizational details, always willing to lend a sympathetic and understanding ear to the trials and tribulations of her authors. Thanks as well to Heather Talbot who picked up this book after many internal changes, keeping it on track and thus guiding it to the light of day. Also, thanks to Chad Beckner for ensuring the technical accuracy of the book, and for continuing to answer—always with good humor—my silly technology questions. And to all the other folks at Premier Press who, while perhaps going specifically unmentioned, have my enduring gratitude for making sure a project is done right, and done well.

Finally, and as always, all my love and thanks to Melissa, Genna, Jackson, and George who make everything possible and inspire me to always do my best.

This page intentionally left blank

About the Author

John W. Gosney is currently Director of Technology Services for the Indiana University School of Dentistry, Indianapolis. He has also served as a technical writer and Web development consultant for a major pharmaceutical corporation. John has worked extensively with Microsoft applications and Web develop-

ment tools for several years, and has experience with ColdFusion and other Web development technologies. He is the author of several books, ranging from test preparation guides to e-business titles. John is also an adjunct instructor for the Community College of Indiana.

John received his B.A. in Technical Writing and Psychobiology in 1992 from Purdue University. In 1996, he was awarded an M.A. in English from Butler University. When not working (which is rare these days!), John enjoys spending as much time as he can with his family, cheering for his favorite teams (Pacers, Colts, and Boilermakers) and furthering his reputation as an expert in all things popular culture.

This page intentionally left blank

Contents at a

Glance

 

Introduction

xix

CHAPTER 1

Preparing to Work with ASP

1

CHAPTER 2

Programming ASP Web Pages with VBScript

23

CHAPTER 3

Working with ASP Objects

43

CHAPTER 4

Working with ASP Components

71

CHAPTER 5

Database Access with ADO

83

CHAPTER 6

Using Forms

109

CHAPTER 7

Essential Programming Logic, Part I

143

CHAPTER 8

Essential Programming Logic, Part II

161

CHAPTER 9

Formatting Processed Output

189

CHAPTER 10

ASP and HTML Scripting with FrontPage 2000

215

CHAPTER 11

Looking Back and Looking Forward

261

APPENDIX A VBScript Variable Reference

267

APPENDIX B

SQL Reference

277

APPENDIX C

Access Essentials

285

 

Index

301