ServersEasy steps to build Web Application using ASP

Easy steps to build Web Application using ASP





by Ajoy Krishnamoorthy

I become nervous when people talk about servers, server-side
scripts or active technologies. It so happens sometimes that the
term gives the shock and not the stuff inside. Surprising to me,
Active Server Pages (ASP) does not scare me in anyway rather it
helped me in building an interactive and dynamic weblication (i mean
a web based application). People dont need a high end programming
expertise to start their ASP programming. It needs a modest
programming skills, the argument which you will agree at the end of
this discussion incase if you dont agree now. This article helps you to start building ASP based web application. This article explain each steps with the sample code. A sample application is also listed along with this article. The source code and the database files are available for you to download and use it.

Let us get on
with the businesss and start building our ASP application.

I
assume you know HTML(Not a big deal to learn). In anycase you can
cut and paste the samples given here and change the titles and
labels wherever required.

Objective:

To build a form to get information like
name, e-mail, comments/feedback etc. from the vistor to your site.
And store all the information in a database for our reference. This
is something which most of us prefer to have in our site so that the
site could be updated based on the user’s feedback and suggestions.

Requirements:

Build a database with a table to store
the details. Create Fields like Name, E-Mail, Comments, Product
Choice etc in the table. Create another table with ProductCode and
Product title as the fields. We are going to use this product table
to populate the select box in the HTML form dynamically.

I
am using Ms-Access to build my database.My database file is
swynk1.mdb. And the tables i have created are Userinfo and Prodinfo.

Access Screen
Fig:Access Screen

Our next step is
to create a directory in the “wwwroot” directory of IIS server. We
need to give read and execute permission to this directory. Then all
our files (.htm,.asp,.mdb,.gif etc) are to be copied to this
directory.

Once the files are copied we need to create a
Data Source Name.

Open the Control panel.Select the ODBC 32
icon from Control Panel and click System DSN Tab. We need to select
the Sysem DSN because it is available to anyone using that Server.
Data sources that you use with Web server hence need to be system
data source. Select add and choose Microsoft Access Drvier from the
list since we are using a Access database. Then we need to give a
DSN name and has to select the Database file. I have given “swynk1”
as the DSN name. This name you will use in the ASP file to get
connected to the database.

After the DSN is created now it
is time to start coding.

First let us create a HTML Form to
get the information from the user.

Going by our objective we
need to create two text boxes to collect name and email information,
one select box to get user’s product choice and one another textarea
box to get user’s comments/feedback. Apart from these we need to
create two buttons to submit and clear the contents.

The
below listing gives the HTML for the Form:

Listing
1:userform.asp

& USER INFORMATION FORM 

WELCOME TO TEST INC.

Thanks for taking time to fill in the feedback form

Name:



E-Mail Address :




Which Product you liked the most?

<option value=''>

Comments/Suggestions:



    

Latest Posts

Related Stories