ASP
ASP
Paper: AC
Gireesh Kumar P
Documentation Research and Training Centre, Bangalore
Abstract
Active Server Pages (ASP) is a server-based technology for
creating dynamic web pages. This is one of the widely used Web
server technologies for creating E-commerce sites. Library can
also use it effectively for designing web based information
services. This paper gives an overview of this technology and
the ways in which it can be used for creating a web -enabled
database.
Paper: AC Gireesh Kumar P
1 Introduction
Web based information services are receiving much attention from library
community. A presence in the global network enables a library to reach to a
wider audience and introduces novel services. The earlier attempts from libraries
of have a presence on Web were limited by hosting few static HTML pages
containing information about the library, and as addition, a links to few sources
of information which are of interest to its users. Even locally developed databases
were converted to 'flat files' and later to plain old HTML Web pages. This trend
is changing and more and more libraries are moving towards hosting dynamic
web pages.
2 Static-Vs-Dynamic pages
A static page remains constant until it is updated and republished. These pages
were not interactive and developers had to physically enter any new information.
With the advances in software and hardware, dynamic pages are being used to
make the Internet more interactive. A dynamic page has the ability to change
every time a user goes to the page. The advantage is that the developer does not
have to enter new information every time the client wants the page to be
updated. A well-developed site will allow client to add, remove, or update
material without any background in programming. In addition, this allows a user
to customize a page so that it may contain material that only the user wants to
see.
The central concept in a dynamic page is that a web server does the processing
before passing information back to the client.
2
Active Server Pages: Technology for Creating……… Paper: AC
the so-called CGI (Common Gateway Interface) scripting languages to create the
customized code.
The problem with CGI is that if five people are submitting a request at the same
time, five different copies of the CGI application have to be running on the server
to handle them. If a hundred people are submitting form information at once - a
hundred copies of the application run at the same time. This makes the Web
server’s functioning slower and slower and finally it may slog.
3
Paper: AC Gireesh Kumar P
Active Server Pages files have a .asp extension and are composed of standard
HTML and some script-logic (usually VBScript, JavaScript, Perl, etc). With ASP,
the code is written in the HTML page itself. The HTML tags and the code are
side by side.
Server locates
Client Requests ASP file the ASP file
on the hard
drive and
Server parses it,
Client
removing all
ASP script
Server Returns HTML text to and replacing
client it with HTML
4
Active Server Pages: Technology for Creating……… Paper: AC
the file and dynamically adds HTML to the rest of the file prior to sending the
"response" to the browser. In other words, the ASP script causes the server to
dynamically generate HTML to be sent to the client. This process has been
graphically illustrated below.
Though ASP is designed primarily for Microsoft's Web servers, it's not necessary
that it will run only on Microsoft's platforms. Couple of companies have created
software that allows ASP pages to run on various Web servers and Platforms.
One of these products is Halcyon Software's Instant ASP, often abbreviated
iASP. Another such product, created by Chili!Soft, is Chili!ASP.
<HTML>
<BODY>
This page was last refreshed on <%= Now %>.
</BODY>
</HTML>
5
Paper: AC Gireesh Kumar P
The VBScript function ‘Now’ returns the current date and time. When the Web
server processes this page, it replaces <%= Now %> with the current date and
time and returns the page to the browser. It may look like the following:
ASP exposes seven built-in objects, which makes a programmer's job easy. These
are Response Object, Request Object, Application Object, Session Object, Server
Object, ObjectContext Object and ASPError Object. These objects can be used to
send an HTML page to the browser, retrieve information from the browser,
communicate with the server, cache data for application, and handle errors. For
instance, the following script uses two objects 'response' and 'request', where one
will gather the IP address (request) and the other (response) will output that to the
browser.
6
Active Server Pages: Technology for Creating……… Paper: AC
A Recordset Object is used to work with the data in a table. It can be used to read
through the rows of a table, modify the rows of a table, or collect new data to be
added to the table. The following scripts illustrate the use of Connection and
Recordset Object.
7
Paper: AC Gireesh Kumar P
After opening a recordset, the records can be read using any Visual Basic Control
Structure.
<%
Dim strSQL
strSQL="SELECT * FROM book WHERE author='Ranganathan '
Dim objRS
Set objRS=Server.CreateObject("ADODB.Recordset")
ObjRS.Open, strSQL, objConn
%>
4 Conclusion
Active Server Pages technology makes server-side scripting available to users of
varying levels of programming skill. By learning a little VBScript and embedding
that code within a web page, the user who is not a professional programmer can
achieve some very professional-looking results with ASP. A library can use this
techno logy for starting new web based information services and customizing the
8
Active Server Pages: Technology for Creating……… Paper: AC
5 References
1. HARAVU (L. J.). Web-enabled databases: an overview of technology and
problems. Information Today and Tomorrow, 19 (1), 2000, pp. 7-10.
2. PEREZ (Ernest). GDIdb: getting your database on the web, with no big deal.
Library Computing, 18 (1), 1999, pp. 29-35.
3. MISCHO (William H.) and SCHLEMBACH (Mary C.). Web-based access to
locally developed databases. Library Computing, 18 (1), 1999, pp. 51-58.
4. 4GuysFromRolla.com. http://www.4guysfromrolla.com/webtech/
5. LearnASP. http://www.learnasp.com
6. ASPFree.com. http://www.aspfree.com/default.asp
7. Active Server Corner. http://www.kamath.com/tutorials/
8. Haneng.com. http://www.haneng.com/search/
9. TAKempis. http://www.takempis.com/information.asp