Cover image for ActivePerl with ASP and ADO
Title:
ActivePerl with ASP and ADO
Author:
Martinsson, Tobias, 1976-
Personal Author:
Publication Information:
New York : John Wiley & Sons, [2000]

©2000
Physical Description:
xxi, 289 pages : illustrations ; 24 cm + 1 computer optical disc (4 3/4 in.)
General Note:
"Wiley Computer Publishing."
Language:
English
ISBN:
9780471383147
Format :
Book

Available:*

Library
Call Number
Material Type
Home Location
Status
Item Holds
Searching...
QA76.73.P22 M352 2000 Book and Software Set Central Closed Stacks
Searching...

On Order

Summary

Summary

"Everything you will need in one book for ASP and ADO programming with Perl and PerlScript. A must-have for every Perl developer's library."-Douglas Lankshear, Senior Developer, ActiveState Tool Corporation
This powerful book/CD package gets you up to speed on all of ActivePerl's features in no time. Tobias Martinsson introduces the tools included in ActivePerl and walks you through installationand configuration, then gives you an overview of the syntax, variables, functions, control structures, and regular expressions of Perl and PerlScript. Chapters on ASP and ADO demystify the jargon, com-ponents, and concepts behind the technologies, and then focus on the objects and functionalities they can add to your programs. Extensive code examples teach you how and where to use the objects, events that trigger them, and how to program with optimal performance in mind. And as a valuable reference, the author provides detailed tables on each object and its associated task options throughout the book to help you harness the full power of ASP and ADO.
Inside, you'll find comprehensive discussions of:
* Perl and PerlScript programming concepts
* Universal Data Access (UDA)
* Database programming
* Active Server Pages (ASP)
* Active Data Objects (ADO): Connection, Command, Error, Field, Parameter, Property, Record, Recordset, and Stream
CD-ROM includes:
* ActivePerl Build 522
* All examples and scripts from the book
* All ADO scripts converted to Perl code


Author Notes

TOBIAS MARTINSSON is a Windows programmer who provides Internet and data access solutions in Perl. He is the author of several articles on ASP and has written on the topic of database programming for Microsoft Internet Developer.


Table of Contents

Acknowledgmentsp. xv
Introductionp. xvii
Chapter 1 Active Server Pagesp. 1
Getting Started with ASPp. 1
To CGI or to ASPp. 2
A Web Service's Nervous Systemp. 4
The Application Objectp. 4
The ASPError Objectp. 5
The ObjectContext Objectp. 5
The Request Objectp. 6
The Response Objectp. 6
The Server Objectp. 6
The Session Objectp. 7
Writing Your Own COM Componentsp. 7
Installing Active Server Pagesp. 7
The PerlScript Enginep. 8
Installationp. 8
Troubleshootingp. 8
Configuring the Scripting Languagep. 9
The Default Languagep. 9
Several Languages in One Filep. 9
Server-Side Configurationp. 10
Windows 95 and 98p. 10
Windows NT 4 and 2000p. 11
Server-Side Include Filesp. 11
Virtual File Namesp. 12
Relative File Namep. 12
The Capacity of SSIp. 12
The Architecture of ASPp. 13
Methodp. 13
Propertyp. 14
Reading a Propertyp. 14
Setting a Propertyp. 14
Eventsp. 14
Collectionp. 14
The Item() Methodp. 15
The Count Propertyp. 16
The Remove() Methodp. 17
The RemoveAll() Methodp. 17
Summaryp. 17
Chapter 2 Perl Programming Basicsp. 19
Getting a Head Start with Perlp. 20
In the Programmer's Toolbox ...p. 20
The ActivePerl Documentationp. 20
Whenever You Need to Ask a Perl Questionp. 21
The Perl Package Managerp. 23
Why Bother Installing Modules?p. 23
Installing Modules with PPMp. 23
Examples of Modulesp. 26
The Standard Perl Modulesp. 27
Introduction to Programming Perlp. 29
Programmatical Grammarp. 29
Scalar Variablesp. 29
The Scalar Variablep. 31
Related Functionsp. 33
The Arrayp. 35
Related Functionsp. 36
The Associative Arrayp. 38
Related Functionsp. 39
References and Nested Data Structuresp. 39
File Handlesp. 43
Special Variablesp. 44
The Control Structures of Perlp. 47
Conditional Control Statementsp. 47
Loop Control Statementsp. 49
The For Loopp. 50
The Foreach Loopp. 50
The While Loopp. 50
The Until Loopp. 51
Labelsp. 51
Regular Expressionsp. 51
Beginning Regular Expressionsp. 51
Pattern Matchingp. 52
Modifiersp. 52
Metacharactersp. 52
Pattern Quantifiersp. 53
Predefined Character Classesp. 53
Matching Locations in a Stringp. 53
Extended Regular Expressionsp. 53
Substitutionp. 54
Translationp. 55
Modular Perl Programmingp. 56
Packagesp. 56
Subroutinesp. 56
Parametersp. 57
Return Valuesp. 60
Prototypesp. 61
Further Referencep. 61
The Symbol Tablep. 61
The Typeglobp. 62
Modulesp. 63
Further Referencep. 63
Object-Oriented Perlp. 63
Summaryp. 67
Further Referencep. 68
Chapter 3 Elevating the Stateless Internetp. 69
Introducing the Not-So-Visible ASP Objectsp. 70
What You Need to Know about Applicationsp. 70
The Eventsp. 71
Sharing Data on the Webp. 72
Application Events in Global.asap. 72
Event: Application_OnStartp. 72
Event: Application_OnEndp. 73
Adding Items to the Contents Collectionp. 73
Issues of Concurrencyp. 73
Cleaning Up the Applicationp. 75
The Session Objectp. 75
Session Events in Global.asap. 76
Event: Session_OnStartp. 76
Event: Session_OnEndp. 76
The Session Object's Processp. 76
Overview: The Applicationp. 78
Overview: The Sessionp. 78
Summaryp. 79
Chapter 4 Practical Active Server Pagesp. 81
Levels of Communicationp. 81
Taking Charge over the HTTP Streamp. 82
An Old Recipe: Cookiesp. 83
When to Serve Cookiesp. 83
A New Cookiep. 84
A Cookie with Subkeysp. 85
Reading Cookiesp. 85
Communicating with the Clientp. 87
Collecting Items in the Query Stringp. 87
The Features of a Query Stringp. 87
In-Memory Storage of Datap. 88
Storing the Items in a Hashp. 88
Storing the Variables in a Cookiep. 88
Example: Combining the Query String and the Sessionp. 90
Validate Submitted Data as Clean and Legal Entriesp. 94
Checking the Form Fieldsp. 94
Checking for a Two-Letter Statep. 96
Formatting Namesp. 96
Checking a Five-Digit Zip Codep. 96
Checking a Phone Number in Format 888-888-8888p. 97
How to Respond to the Clientp. 97
Sending a Status Headerp. 97
Redirecting the Browserp. 97
The Form Collectionp. 98
Example: Fetching a Remote Web Pagep. 98
Client Certificates for Securityp. 99
Server Variablesp. 101
Example: Dumping All Server Variablesp. 101
A Note for the COM Developerp. 102
Overview: The Response Objectp. 103
Overview: The Request Objectp. 103
Summaryp. 105
Chapter 5 The Special Utility Objectsp. 107
The Swiss Army Knife of ASPp. 107
The Server's Propertyp. 107
ScriptTimeoutp. 108
The Utility Methodsp. 108
The CreateObject() Methodp. 108
The Execute() Methodp. 108
The GetLastError() Methodp. 109
The HTMLEncode() Methodp. 109
The MapPath() Methodp. 109
The Transfer() Methodp. 111
URLEncode() Methodp. 111
Overview: The Server Objectp. 111
A Transactional Utilityp. 111
Controlling Transactionsp. 111
The ObjectContext Objectp. 112
Everything about Errorsp. 112
The ASPError Objectp. 113
Summaryp. 113
Chapter 6 Universal Data Accessp. 115
Microsoft Data Access Componentsp. 115
The Medicine for Data Accessp. 115
A and [Omega] of Relational Databasesp. 118
The Structured Query Languagep. 120
Data Manipulation Languagep. 120
The Select Clausep. 121
BETWEENp. 123
LIKEp. 123
INp. 124
NOTp. 124
NULLp. 124
ALL, DISTINCTp. 125
Joining Tablesp. 125
Data Definition Languagep. 126
CREATEp. 126
DROPp. 126
ALTERp. 126
Data Control Languagep. 127
ActiveX Data Objects for Data Accessp. 127
Behind ADOp. 127
The OLE DB Data Providerp. 128
Dynamic Propertiesp. 129
Built-In Propertiesp. 130
The Data Sourcep. 130
The Native Providerp. 131
Universal Data Linkp. 132
Data Source Namep. 132
Creating a System DSNp. 133
Creating a File DSNp. 133
No DSN or DSN-Lessp. 133
Example with SQL Server and OLE DBp. 134
The OLE DB Consumerp. 134
The ADO Object Modelp. 134
Connectionp. 135
Recordsetp. 135
Commandp. 136
Parameterp. 136
Fieldp. 136
Errorp. 136
Propertyp. 136
Recordp. 136
Streamp. 136
System and Software Requirementsp. 137
Database Requirementsp. 137
Summaryp. 137
Chapter 7 Database Programming in ADOp. 139
Introduction to the Connectionp. 139
The Syntaxp. 139
Making the Connectionp. 141
Connecting without a DSNp. 141
Checking the Database Session for Errorsp. 143
Executing an SQL Queryp. 144
Making the Selectionp. 144
Examining an Errorp. 145
Performance Tweakingp. 147
Learning the Database Structurep. 150
Inserting New Recordsp. 156
Creating Database Tablesp. 157
Deleting Database Tablesp. 159
Database Transactionsp. 159
Overview: The Connectionp. 159
Summaryp. 159
Chapter 8 The Heart of ADOp. 163
Introduction to the Recordsetp. 163
The Syntaxp. 163
Perfecting the Recordsetp. 164
The Cursor Type Propertyp. 164
The Right Type of Cursorp. 165
The LockType Propertyp. 166
The Right Type of Lockp. 166
Rows and Columnsp. 167
How to Create the Recordsetp. 169
The Everyday Recordsetp. 169
A Better Recordsetp. 171
Examples of How To ...p. 172
Escape the While Loop and Catch Up on Speedp. 172
Splitting the Recordset into Book Pagesp. 174
Using GetRows with CacheSizep. 180
Searching for a Recordp. 181
Features You May Accessp. 182
A New Group of Records with Filterp. 183
Ordering the Recordsp. 184
Deleting Recordsp. 184
Adding New Recordsp. 185
ADO from Command Line Perlp. 186
Back and Forth--Script Conversionp. 187
Accessing ADO from Perlp. 187
Splitting a Recordset with Perlp. 188
The Disconnected Recordsetsp. 194
No Connectionsp. 194
Hanging Up on the Data Sourcep. 195
Creating the Recordset Programmaticallyp. 197
Persisting a Recordsetp. 199
Saving It as a Filep. 199
As an XML Documentp. 200
In the Binary ADTG Formatp. 201
Reading a Persisted Recordset from Filep. 202
Persisting a Recordset to the ASP Response Objectp. 202
Shaped Hierarchical Recordsetsp. 203
The Shape Languagep. 203
A Relation-Based Hierarchyp. 204
Parameterized Shape Statementsp. 211
A Computed or Grouped Hierarchyp. 211
Disconnected Hierarchical Recordsetsp. 215
Reshaping the Hierarchyp. 224
Overview: The Recordsetp. 224
Summaryp. 225
Chapter 9 Fast Queries with the Command Objectp. 227
Introduction to the Commandp. 227
Preparing a Fast Queryp. 227
Parametersp. 229
Creating the Parametersp. 229
An Overview of the Parameter Objectp. 232
Overview: The Commandp. 232
Summaryp. 234
Chapter 10 A Natural Systems Recordp. 235
Introduction to the Recordp. 235
Getting Your Hands on a Recordp. 235
Moving, Deleting, and Copyingp. 240
CopyRecordp. 240
DeleteRecordp. 241
MoveRecordp. 241
Overview: The Recordp. 241
Summaryp. 243
Chapter 11 Working the Stream of Datap. 245
Introduction to the Streamp. 245
Opening the Streamp. 245
Overview: The Streamp. 247
Summaryp. 248
Appendix A Bag of Scriptsp. 251
Appendix B What's on the CD-ROMp. 263
Appendix C The HTTP Status Descriptionp. 267
Appendix D Content Typesp. 269
Appendix E ActivePerl Activity on the Webp. 271
Glossaryp. 273
Indexp. 279