SlideShare a Scribd company logo
1 of 252
ASP
ACTIVE
SERVER PAGE
ASP developed in November 1996
by Microsoft. An ASP file can
contain text, HTML tags and
scripts. Scripts in an ASP file are
executed on the server.
1. ASP stands for Active Server Pages
2. ASP is a program that runs inside IIS
3. IIS stands for Internet Information Services
4. IIS comes as a free component with Windows 2000
5. IIS is also a part of the Windows NT 4.0 Option Pack
6. The Option Pack can be downloaded from Microsoft
7. PWS is a smaller - but fully functional - version of IIS
8. PWS can be found on your Windows 95/98 CD
• Dynamically edit, change or add any
  content of a Web page

• Respond to user queries or data
  submitted from HTML forms

• Access any data or databases and return
  the results to a browser
• Customize a Web page to make it more
  useful for individual users

• The advantages of using ASP instead
  of CGI and Perl, are those of simplicity
  and speed

• Provide security since your ASP code
  can not be viewed from the browser

• Clever ASP programming can minimize
  the network traffic
ASP is a mixture of HTML and scripting
that enables you to build dynamic and database-
driven
                         web sites.


ASP is a server - side scripting environment
that we can use to create and run dynamic,
interactive, high - performance Web server
applications."
A server is a computer (Usually high-end, "Faster,
Bigger") that allows computers in a network to have
a shared resource.
Most servers in the area are used to

share files
to run programs
or to share Printers

The different rolls that servers play in the area are:
PDC (Primary Domain Controller)

These servers are the bosses of 1 or more servers.
All usernames and passwords are kept on the PDC.

BDC (Backup Domain Controller)

These servers are the backups which take over if the PDC fails.
They keep a copy of the Usernames and Passwords to
validate logons incase the PDC is busy.

Server
These servers are just ordinary servers that can join a domain
but can not replace a PDC like a BDC.
These servers usually are setup to just share files or printers.
Print Server
These servers are usually assigned network printers
to share and maintain.

File Servers
These servers have folders/directories shared
for access by network users.

Application Servers
These servers have programs that are shared
across the network to multiple computers.
    A server can only be one of these but can be
                        any
           combination of file, print, and
                 application server
A protocol is a set of rules that governs the
communications between computers
on a network.
These rules include guidelines that regulate
 the following characteristics of a network
access method, allowed physical space,
 types of cabling, and speed of data transfer.
       The most common protocols
       are:
       Ethernet
       Local Talk
       Token Ring
       FDDI
       ATM
HTTP (Hypertext Transfer Protocol)
is the set of rules for transferring files
(text, graphic images, sound, video, and other
multimedia files) on the World Wide Web.
As soon as a Web user opens their Web browser,
 the user is indirectly making use of HTTP.
PWS   is for older Windows system
 like Windows 95, 98, and NT.
PWS is easy to install and can be
 used for developing and testing web
 applications including ASP.
Open the Add-ons folder on your Windows98 CD,
 find the PWS folder and run the setup.exe file.
An Inetpub folder will be created on your hard drive.
 Open it and find the wwwroot folder.
Create a new folder, like "MyWeb", under wwwroot.
Use a text editor to write some ASP code,
save the file as "test1.asp" in the "MyWeb" folder.

Make sure your Web server is running –
The installation program has added a new icon on your task bar
 this is the PWS symbol). Click on the icon and press the Start
button in the window that appears.
Open your browser and type in
 http://localhost/MyWeb/test1.asp", to view your first ASP page.
Note: You cannot run ASP on Windows XP Home Edition.
         Insert the Windows XP Professional CD-Rom
                     into your CD-Rom Drive
            From your Start Button, go to Settings,
                       and Control Panel
 In the Control Panel window select Add/Remove Programs
  In the Add/Remove window select Add/Remove Windows
                          Components
In the Wizard window check Internet Information Services ,
                             click OK
An Inetpub folder will be created on your hard drive

Open the Inetpub folder, and find a folder named wwwroot

Create a new folder , like "MyWeb", under wwwroot.

Use a text editor to write some ASP code, save the file
as "test1.asp" in the "MyWeb" folder

Make sure your Web server is running - its status can be
checked by going into the Control Panel,

then Administrative Tools , and double-click
the "IIS Manager" icon

Open your browser and type
in "http://localhost/MyWeb/test1.asp", to view your first ASP page
Client/server model is a concept for describing
                communications
                    between
         computing processes that are
                  classified as
          service consumers (clients)
        and service providers (servers).
Client/server describes the relationship between
        two computer programs in which
            one program, the client,
          makes a service request from
          another program, the server,
            which fulfills the request
Request



client              server

         Response
A scripting language has a particular
syntax used to execute commands on a
computer. A program composed of
commands from a particular scripting
language is referred to as a script.
The client, processes client side script. It is the
  client’s responsibility to execute all Client-Side
  scripts. Client side scripting is programmatic
  code in an HTML file that runs on the
 browser.
It is denoted by the <Script> tag. It is commonly
written using JavaScript Programming language
  due to the fact
that Netscape support JavaScript language for
  client-side scripting.
Server-side scripts are processed completely on
 the web server.
The client does not receive any code from
server-side scripts; rather, the client receives just
 the output of the server-side scripts.
Client-side scripts and server side scripts cannot
 interact with one another because the
client – side scripts are executed on the client,
after the server-side scripts have finished
processing completely.
ASP script is a server side scripting.
In order to activate ASP components
and to use its objects, a script is placed
on the Web page along with the HTML
codes specifying how the generated
information is to be formatted for display
in the browser.
This script is written in the VBScript
language and is contained inside the
special symbols <% and %>
to indicate its presence to the server:
<%
This is a script
%>
After   you have installed IIS or
   PWS follow these steps:
1. Look for a new folder called
   Inetpub on your hard drive
2.Open the Inetpub folder, and
   find a folder named wwwroot
3.   Write some ASP code and save
     the file as “first.asp" in the new
     folder
4.   Make sure your Web server is
     running
6.   Open your browser and type
     "http://localhost/first.asp", to
     view your first web page
Response.write     command is just
like the printf command in C. The
response.write command is used
to write output to a browser. The
following example sends the text “My
First ASP Program !" to the browser:
<html>
 <head>
<title>First ASP Program</title>
</head>
<body>
 <%
 response.write(“My First ASP
 Program !")
 %>
 </body>
 </html>
<%
response.write "Hello ASP World<br>"
response.write "Today is " & Date
response.write " and the time is " & Time
%>
ASP uses VBScript as its default
programming language. This means
VBScript comments are ASP
comments. That means there isn't any
support for multiple line comments
that you see in HTML and various
other programming languages.
   To create comment in ASP you simply place an apostrophe ‘
    in front of what you want to make a comment.

 <%
 ‘This is a comment
 Response.write(“this is a comment”)
 %>
When the server invokes the ASP scripting
engine, it parse the file and inserts any
include files. It then collects the script
portion by finding all the script
delimiter.The ASP treats all non-script
contents as strings that it writes
verbatim(Exactly) back to the client. Next
the scripting engine creates variables and
external components invoked by the script.
Finally it begins the script executing each
command and sending results to the client.
Request
                    ASP.DLL         ASP
                                  Scripting
                                   Engine

         Response   HTML
                    Coding        Processing


Client
                         Server
    The process of ASP script is goes through these
     five stages
1.   Request: The web browser contacts the server
     and tells it what page it wants to see
2.   Pre-processing : The asp.dill file does some initial
     processing on the requested script.
3.   Execution : The scripting engine executes the
     instructions in the script
4.   Translate: ASP translate the result of the
     execution into HTML
5.   Display: The HTML is sent back to the
     browser,which process the tags and display it.
•A variable is used to store information for later use.

•ASP is not a language in itself. To program ASP you
actually need to know the VBScript scripting language.
This means that all VBScript variable rules can be
applied to your ASP code.
•In ASP you declare a variable with the use of the Dim
keyword, which is short for Dimension.
•(Dimension in English refers to the amount of space
something takes up in the real world, but in
computer terms it refers to space in computer
memory.)
 The  value of each variable is held in the server's
  memory, so the value of the variable can be
  manipulated or displayed as needed within a
  page.
 In VBScript, there is only one data type, and that
  is variant.
 A variant can hold either strings or numbers,
  and will behave as a number if its numeric, and
  as a string for string values.
 In ASP, it is not necessary to declare your
  variables before using them.
 If, however, you choose to do so, you use the
  DIM statement
 ASP      Variable Naming Conventions
    Once again, ASP uses VBScript by default and so it
     also uses VBScripts variable naming conventions.
     These rules are:
1.   Variable name must start with an alphabetic
     character (A through Z or a through z)
2.   Variables cannot contain a period
3.   Variables cannot be longer than 255 characters
     (don't think that'll be a problem!)
4.   Variables must be unique in the scope in which it is
     declared.
Assigning values in ASP is straightforward enough,
just use the equals "=" operator. Ahead we have set a
variable equal to a number and a separate variable
equal to a string.
A   variable declared outside a procedure can be
  accessed and changed by any script in the ASP file.
 A variable declared inside a procedure is created and
  destroyed every time the procedure is executed. No
  scripts outside the procedure can access or change
  the variable.
 To declare variables accessible to more than one ASP
  file, declare them as session variables or application
  variables.
 Session   Variables
 Sessionvariables are used to store information
 about ONE single user, and are available to all pages
 in one application. Typically information stored in
 session variables are name, id, and preferences.

 Application    Variables
 Application variables are also available to all
  pages in one application. Application
  variables are used to store information about
  ALL users in one specific application.
<%
' Note that lines starting with a single quote are comments.
' Commented lines are not executed.
' First, declare variables using Dim. This is optional

Dim a, b, c, d, e, f
a=1
b=2
c= a + b
d="The value of "
e=" plus "
f=" equals "
response.write (d & a & e & b & f & c)
%>
                     The script output is:
                 The value of 1 plus 2 equals 3
<html>
<body>

<%
dim name
name=" Mickey Mouse "
response .write ("My name is: " & name)
%>

</body>
</html>
Comparison operators are used when you
want to compare two values to make a
decision. Comparison operators are most
commonly used in conjunction with
"If...Then" and "While statements,
 otherwise known as conditional statements.
The items that are most often compared are
numbers.
The result of a comparison operator is either
TRUE or FALSE.
A logical operator is used for complex
statements that must
make decisions based on one or more of
these truth values.
The only string operator is the string concatenation
operator "&" that takes
two strings and join them together to form a new string.
An example would be
string1 = "Tim" and string2 = " is a Hero".
The following code would combine these two strings into
one: string3 = string1 & string2
A control structure is a programming structure
that allows your program to make decisions.

Types of controls

There are three major types of controls structures

1. Conditional logic
2. Looping logic
3. Branching logic
Conditional logic allows you to match condition
if condition matches then result come if condition
not matches result not come


Example

In job selection form if age is less then 27 then you can
fill form
or
if age is more then 27 then you are not eligible for
this job.
<%

Dim Result
Result = 70

if Result >= 57 then
   response.write("Pass")
else
   response.write("Fail")
end if
%>
<%
Dim Result
Result = 70

if Result >= 75 then
   response.write("Passed: Grade A ")
elseif Result >= 60 then
   response.write("Passed: Grade B ")
elseif Result >= 45 then
   response.write("Passed: Grade C ")
else
   response.write("Failed ")
end if
%>
<%@ language="vbscript“%>
<%
Dim Flower
Flower = "rose"

select case flower
 case "rose"
   response.write(flower & " costs 20rs")
 case "daisy"
   response.write(flower & " costs 15rs")
 case "orchild"
   response.write(flower & " costs 12rs")
 case else
   response.write("There is no such flower in our shop")
end select
%>
ASP performs several types of repetitive operations,
called "looping".

Loops are set of instructions used to repeat the same
block of code till a specified condition returns false
or true depending on how you need it.

To control the loops you can use counter variable
that increments or decrements with each repetition
of the loop.
<%@ language="vbscript" %>
<%
For i = 0 to 10
 response.write("The number is " & i &
"<br>")
Next
%>
<%@ language="vbscript" %>
<%
response.write("<h1>Multiplication table</h1>")
response.write("<table border=2 width=50>")
Dim i
For i=1 to 10
response.write("<tr>")
response.write("<td>"& i &"</td>")
Dim j
For j=2 to 43
response.write("<td>"&i * j &"</td>")
Next
response.write("</tr>")
Next
response.write("</table>")
%>
<%
Dim i
i=0
Do While i<=10
 response. write( i & "<br>")
  i=i+1
Loop
%>
<%
a=1
Do while a < 11
  response.write "This is loop " & a & "<br>"
  a=a+1
Loop
%>


<%
a=1
Do until a = 11
  response.write "This is loop " & a & "<br>"
  a=a+1
Loop
%>
<%
a=1
Do until a = 11
  If a < 6 then
     response.write "This is loop " & a & "<br>"
     a=a+1
  Else
     Exit Do
  End If
Loop
%>
   The branch logic control refers to the process of
    leaving the current flow of the program to a new
    set of instructions. There are two types of
    branching logic controls: subroutines (procedure)
    and functions. The subroutines perform actions
    and functions compute values. We first start with
    subroutines.
Subroutines   are used to perform an
 action. An example of action might
 be to print a message to the screen.
When calling a VBScript or a
 JavaScript procedure from an ASP
 file written in VBScript, you can use
 the "call" keyword followed by the
 procedure name.
 Functions  are written to perform calculations.
  Like subroutines, functions can take one or more
  arguments. Functions can also return one value.
 A function begins with the keyword function and
  ends with the keyword END FUNCTION.
 FUNCTION AbValue (inNo)
  If inNo < 0 then
  inNo = - inNo
 END IF
  AbValue = inNo
 END FUNCTION
 The value that is returned by a function can be
  printed or assigned to another variable for later
  use in the program.
Functions and sub procedures have many
similarities:
• They can be called or invoked from anywhere within your
script.
•A function or sub procedure can be reused as many times
as required, thus saving you time writing out repetitive
code Both are blocks of self contained code that can
accept arguments.
•Both will only run when called or invoked from code
elsewhere and will not run automatically when the page is
loaded. The difference between a function and a sub is that
a sub will do some stuff (like printing something to the
screen) and then quit, while a function runs some code
and then returns the result back to the code that called it.
•A Function could be used to do a calculation and then
return a result.
Insert the
<%@ language="language" %>
line above the <html> tag to write the
procedure/function in another scripting language:

<%@ language="javascript" %>
<%@ language=“vbscript" %>
<html>
<head>
<%
sub name()
response.write (“My name is Hunter")
end sub
%>
</head><body>
<%
response.write(“Welcome today is Monday")
response.write("<br>")
call name
response.write("<br>")
response.write("thanks")
%>
</body></html>
<html><head>
<%
function sum (x,y)
sum=x+y
end function
%>
</head><body>
<%
dim x,y,z
x=20
y=40
z=sum(x,y)
response.write ("sum is " & z)
%>
</body></html>
   Vb
    Scri
    pt
    arra
    y is
    0
    base
    d,
    mea
    ning
    that
    the
    arra
    y
    elem
    ent
    inde
static array remains with fixed size throughout their life
 open. To use static array you need to know upfront the
 maximum number of the elements this array will
 contain.
                  If you need more flexible vb script array
 with variable index size, then you can use dynamic array.
Dynamic array index size can be increased/decreased
 during their life span.
 Create static array called “arrcar” that will hold the name of
  five cars.
 <%
 Dim arrcar
 arrcar=Array("Audi","Honda
  city","Mercedes","Safari","Bentley")
 For I=0 to 4
 Response.write arrcar(i) & "<br>"
 Next
 %>
    Dynamic array comes in handy (Versatile) when
     you aren’t sure how many items your array will
     hold. To create a dynamic array you should use
     the dim statement along with the array’s name,
     within specifying upper bound.
    <%
     dim arrcar
     arrcar=array()
    %>
     In order to use this array you need to use the
     ReDim statement to define the array’s upper
     bound:
 Dim arrcar
 arrcar=Array()
 Redim arrcar(27)
 If in future you need to resize this array, you should use
  the redim statement again. Be very careful with the redim
  statement. When you use the redim statement you lose all
  the element of the array. Using the keyword PRESERVE
  in conjunction with the redim statement will keep the
  array we already have and increase the size.
 <%
 Dim arrcar
 Arrcar=array()
 Redim arrcar(27)
 Redim PRESERVE arrcar(52)
 %>
 <%
 Dim arrcar
 redim arrcar(3)
 arrcar=Array("Audi","Honda
  city","Mercedes","Safari","Bentley","lemo","alto")
 redim preserve arrcar(7)
 For i=0 to 6
 Response.write arrcar(i) & "<br>"
 Next
 %>
 Array  don’t have to be a simple list of keys and
  values, each location in the array can hold another
  array. The reason you may use this type of array is
  when you have records of each item.
 For example car,year,price,……

  and you want to display one record at a time.
            The most commonly used are two-
  dimensional arrays.You can thin of two
  dimensional array as a matrix, or grid , with width
  and height of rows and columns. Here is
 how you could define two-dimensional array and display the
  array values on the web page.
 <%
 dim arrcar(2,4)
 arrcar(0,0)="honda city"
 arrcar(1,0)="2009"
 arrcar(2,0)="859598"


 arrcar(0,1)="audi"
 arrcar(1,1)="2009"
 arrcar(2,1)="450000"
 arrcar(0,2)="honda city"
 arrcar(1,2)="2009"
 arrcar(2,2)="700000"


 arrcar(0,3)="safri"
 arrcar(1,3)="2009"
 arrcar(2,3)="6,00000"


 arrcar(0,4)="lemo"
 arrcar(1,4)="2009"
 arrcar(2,4)="990000"
 response.write ("<table border=2>")
 response.write ("<tr> <td>row</td><td>car</td>
  <td>year</td> <td>price</td> </tr>")
 for i=0 to ubound (arrcar,2)
 response.write ("<tr> <td>" & i & "</td>")
 response.write("<td>" & arrcar (0,i) & "</td>")
 response.write("<td>" & arrcar (1,i) & "</td>")
 response.write("<td>" & arrcar (2,i) & "</td>")
 next
 response.write("</table>")
 %>
 dim a(1,1)
 a(0,0)="HTML"

 a(0,1)="Hyper Text Markup Language“

 a(1,0)="ASP"

 a(1,1)="Active Server Page“

 for i=0 to ubound(a,1)

 response.write("<table width=60% ><tr><td>")

 response.write(a(0,i)& "</td><td>")

 response.write(a(1,i)&"</td></tr>")

 next

 response.write("</table>")
Vb script is client side script
language and run on client side so
we do not require server and asp.
It is lighter because no load at
server it completely run at client
side because all codes written in
html.
Conversion of one data type to another is called type
  casting
Cint
Cdate
Asc
   ASC
 <%
 response.write("ANSI   code of a string is: " &
  asc("a"))
 %>
   Cdate
 converts the date expression to the variant of
  subtype date
 <%
 a="march 14,1985"
 response.write ("<br>" & cdate(a))
 %>
   Cint
 Converts   an expression to a variant of subtype
  Integer.
 <%
 Response.write(Cint(2314.166))
 %>
 Date
 <%
 response.write("current   date of the system:“ & date)
 %>
 Time
 <%
 response.write(“Current   time of the system" & time)
 %>
 Day
 <%
 response.write(“day   of the system: " &day(date))
 %>
 WeekDayName
 <%
 response.write(“Name   of the weekday :" &
  weekdayname(1))
 %>
 WeekDay
 <%
 response.write("week day : " & weekday(date))
 %>
 Month
 <%
 response.write("<br> month" &month(date))
 %>
   MonthName
 response.write(“Name     of the month“ &
    monthname(3))
   Year
 <%
 response.write("year:“   & year(date))
 %>
 DateDiff
 <%
 response.write("day"  &
  datediff("d",date,“01/01/2000"))
 response.write("<br> Year" & datediff("yyyy",date,"
  01/01/2000"))
 response.write("<br> month" & datediff("m",date,"
  01/01/2000"))
 response.write("<br> Mintue" & datediff("n",date,"
  01/01/2000 "))
 response.write("<br> hour" & datediff("h",date,"
  01/01/2000 "))
 response.write("<br> second" & datediff("s",date,"
  01/01/2000"))
 %>
1.   Abs function
    The Abs function returns the absolute value of a
     specified number.
    Example
    <%
    Response.write (Abs(1) & “<br>”)
    Response.write(Abs(-1))
    %>
 Cos Function
 The cos function returns the cosine of a specified number.


 <%
 Response.write(cos(50.0))
 %>
 Exp Function
 The Exp function returns e raised to a power.
 <%
 Response.write(exp(6.7))
 %>


 IntFunction
 The int function returns the integer part of a
  number
 <%
 Response.write(int(6.83227))
 %>
 Sqr Function
 The sqr function returns the square root of a
  number.
 <%
 Response.write(sqr(9))
 %>
 Tan Function
 The tan function returns the tangent of a number
< %
 Response.write(tan(59))
 %>
The InStr function returns the position
of the first occurrence of one string
within another.
     <%
     dim a,b
     a="Have a Great Day Enjoy"
     b=instr(a,"Great")
     response.write(b)
     %>

    Output:8
The InStrRev function returns the position
of the first occurrence of one string within
another. The search begins from the end of
string, but the position returned counts from
the beginning of the string
    <%
    dim a,b
    a="Have a Great Day Enjoy"
    b=instrrev(a,"Day")
    response.write(b)
    %>
    Output:14
The LCase function converts a
  specified string to lowercase.



dim a
 a=“HAVE A GREAT DAY!"
response.write(LCase(a))

Output: have a great day!
The Left function returns a specified
number of characters from the left
side of a string.


   dim a
    a="This is a beautiful day!"
   response.write(Left(a,11))

   Output:This is a b
The Len function returns the number of
characters in a string.



     dim a
      a="This is a beautiful day!"
     response.write(Len(a))

     Output:24
The Mid function returns a specified
number of characters from a string.

  <%
  dim a
  a="Have a Great Day Enjoy"
  b=mid(a,8,9)
  response.write(b)
  %>

  Output: Great Day
The Replace function replaces a specified
  part of a string with another string a
  specified number of times



dim a
 a="This is a beautiful day!"
response.write(Replace(a,"beautiful","horrible"))

Output:This is a horrible day!
The String function returns a string
that contains a repeating character
 of a specified length.



   response.write(String(10,"#"))
   Output:##########
    An object is a thing or an entity like pen, table,
     chair, mobile phone, car etc. in other words, an
     object is a reusable component that contains
     related data and functions that represent some
     real-life things.
    A property is a basic characteristics of an object
     or you can say property is a value that describe the
     object, like color, shape etc.
    A method is something you can do with the
     object. In other words, method is a function which
     can be performed on the object. For example:
1.   Pen is used for writing.
2.   Chair is used for sitting.
Active Server Pages consist of six built in objects.
They are ready made objects which provide
functionality to your web pages without requiring
you to make custom objects

  Following are the six built in ASP objects :

  1. Application
  2. ASP Error
  3. Request
  4. Response
  5. Server
  6. Session
A group of ASP files that work
together to perform some purpose
is called an application.
ASession object stores information
about, or change settings for a user
session. Only store SMALL amounts
of data in session variables!
   The Response object is used to send the output back to
    the client (browser). It includes all the HTTP variables,
    cookies that will be stored on the client browser and other
    info about the content being sent
The Request object makes available all the values that client
 browser passes to the server during an HTTP request. It
 includes client browser info, cookie details ( of this
 domain only ), client certificates ( if accessing through
 SSL ) etc.
The ASPError object, implemented
 in ASP 3.0, contains detailed
 information about the last error
 that has occurred.
 An application on the Web may consists of
  several ASP files that work together to
  perform some purpose. The Application
  object is used to tie these files together.
 The Application object is used to store and
  access variables from any page, just like the
  Session object. The difference is that ALL
  users share ONE Application object (with
  Sessions there is ONE Session object for
  EACH user).
The  Application object holds
 information that will be used by many
 pages in the application (like database
 connection information). The
 information can be accessed from any
 page. The information can also be
 changed in one place, and the changes
 will automatically be reflected on all
 pages.
Store and Retrieve Application
            Variables
Application  variables can be
 accessed and changed by any page
 in an application.
You can create Application
 variables in "Global.asa"
Store and Retrieve Application Variables

Application variables can be accessed and changed
by any page in the application.

You can create Application variables in "Global.asa"

<script language="vbscript" runat="server">
Sub Application_OnStart
   application(“cname")=“ infosys delhi "
End Sub
</script>
The  Global.asa file is an optional file
 that can contain declarations of objects,
 variables, and methods that can be
 accessed by every page in an ASP
 application.
All valid browser scripts (JavaScript,
 VBScript, PerlScript, etc.) can be used
 within Global.asa.
The  Global.asa file can contain only
 the following:
Application events
Session events
<object> declarations
Type Library declarations
the #include directive
Note: The Global.asa file must be
 stored in the root directory of the ASP
 application, and each application can
 only have one Global.asa file.
In Global.asa you can tell the application
 and session objects what to do when the
 application/session starts and what to
 do when the application/session ends.
 The code for this is placed in event
 handlers. The Global.asa file can contain
 four types of events:
Application_OnStart         - Occurs when
 the FIRST user calls the first page in an
 ASP application. This event occurs after
 the Web server is restarted or after the
 Global.asa file is edited. The
 "Session_OnStart" event occurs
 immediately after this event.
 Session_OnStart - This event occurs
 EVERY time a NEW user requests his or
 her first page in the ASP application.
Session_OnEnd        - This event occurs
 EVERY time a user ends a session. A
 user-session ends after a page has not
 been requested by the user for a specified
 time (by default this is 20 minutes).
Application_OnEnd - This event
 occurs after the LAST user has ended the
 session. Typically, this event occurs when
 a Web server stops. This procedure is
 used to clean up settings after the
 Application stops, like delete records or
 write information to text files.
<script language="vbscript"
 runat="server">
 sub Application_OnStart
 'some code
 end sub
 sub Application_OnEnd
 'some code
 end sub
 sub Session_OnStart
 'some code
 end sub
sub Session_OnEnd
 'some code
 end sub

 </script>

Because   we cannot use the ASP script
 delimiters (<% and %>) to insert
 scripts in the Global.asa file, we put
 subroutines inside an HTML <script>
 element.
In this example we will create a
 Global.asa file that counts the
 number of current visitors.
The Application_OnStart sets the
 Application variable "visitors" to 0
 when the server starts
The Session_OnStart subroutine
 adds one to the variable "visitors"
 every time a new visitor arrives
The Session_OnEnd subroutine
 subtracts one from "visitors" each
 time this subroutine is triggered
The Global.asa file:
<script language="vbscript"
 runat="server">

 Sub Application_OnStart
 Application("visitors")=0
 End Sub
Sub Session_OnStart
 Application.Lock
 Application("visitors")=Application("visit
 ors")+1
 Application.UnLock
 End Sub
 Sub Session_OnEnd
 Application.Lock
 Application("visitors")=Application("visit
 ors")-1
 Application.UnLock
 End Sub
 </script>
To  display the number of current
 visitors in an ASP file:
<html>
 <head>
 </head>
 <body>
 <p>There are <
 %response.write(Application("visit
 ors"))%> online now!</p>
 </body>
 </html>
The Global.asa file is contain declarations
of objects, variables, and methods that can be
accessed by every
page in an ASP application. All valid browser scripts
(JavaScript, VBScript, PerlScript, etc.)
can be used within Global.asa.
The ASP Server object is used to access properties
and methods on the server. Its properties and methods
 are described below:
 Properties
 Script Timeout
 Sets or returns the maximum number of seconds a
 script can run before it is terminated

  Methods
  Create Object
  Creates an instance of an object
  Execute
  Executes an ASP file from inside another ASP file
GetLastError()
Returns an ASP Error object that describes the error
condition that occurred
HTMLEncode
Applies HTML encoding to a specified string
<%
= Server.HTMLEncode("The paragraph tag: <P>")
 %>
MapPath
Maps a specified path to a physical path
<%
=Server.MapPath(Request.ServerVariables("PATH_INFO"))
%>
Transfer
Sends (transfers) all the information created in one
  ASP file to a second ASP file
URLEncode
Applies URL encoding rules to a specified string
ASession object stores information
about, or change settings for a user
session. Only store SMALL amounts of
data in session variables!
When   you are working with an application
 on your computer, you open it, do some
 changes and then you close it. This is
 much like a Session.
The computer knows who you are. It
 knows when you open the application and
 when you close it.
 Variables stored in a Session object hold
 information about one single user, and are
 available to all pages in one application.
 Common information stored in
 session variables are name, id, and
 preferences.
The server creates a new Session
 object for each new user, and destroys
 the Session object when the session
 expires.
A   session starts when:
A new user requests an ASP file, and the
 Global.asa file includes a Session_OnStart
 procedure
A value is stored in a Session variable
A user requests an ASP file, and the
 Global.asa file uses the <object> tag to
 instantiate an object with session scope
The  most important thing about the
 Session object is that you can store
 variables in it.
The example ahead will set the
 Session variable username to
 “Shawn" and the Session variable age
 to “30":
<%
Session("username")=“Shawn"
Session("age")=30
%>
When   the value is stored in a session
 variable it can be reached from ANY
 page in the ASP application:
Welcome
<%
Response.Write(Session("username")
 )
%>
The line above returns: "Welcome
 Shawn".
The  Contents collection contains all
 session variables.
The example ahead removes the
 session variable "sale" if the value of
 the session variable "age" is lower
 than 18:
<%
 If Session.Contents("age")<18 then
  Session.Contents.Remove("sale")
 End If
 %>
To remove all variables in a session, use
 the RemoveAll method:
<%
 Session.Contents.RemoveAll()
 %>
Properties
SessionID

 The SessionID is a read-only property that uniquely
identifies each current user's session. Each session has
a unique identifier that is generated by the server when
the session is created and stored as a cookie on the
client machine.
TimeOut

The Timeout property sets or returns the timeout period
(in minutes) for thе Session object in this application.
 If the user does not refresh or request a page within the
 timeout period,the session ends. Can be changed in
individual pages as required.
Acookie is often used to identify a
user.
Acookie is often used to identify a
user. A cookie is a small file that the
server embeds on the user's
computer. Each time the same
computer requests a page with a
browser, it will send the cookie too.
With ASP, you can both create and
retrieve cookie values.
The  "Response.Cookies" command is
 used to create cookies.
The Response.Cookies command
 must appear BEFORE the <html>
 tag.
IN THE EXAMPLE BELOW, WE WILL
CREATE A COOKIE NAMED
"FIRSTNAME" AND ASSIGN THE
VALUE "ALEX" TO IT:

<%
 Response.Cookies("firstname")="Alex"
 %>
IT IS ALSO POSSIBLE TO ASSIGN
PROPERTIES TO A COOKIE, LIKE
SETTING A DATE WHEN THE COOKIE
SHOULD EXPIRE:
<%
Response.Cookies("firstname")="Alex
Response.Cookies("firstname").Expires
 =#May 10,2012#
 %>
The"Request.Cookies"
command is used to retrieve a
cookie value
IN THE EXAMPLE BELOW, WE
RETRIEVE THE VALUE OF THE COOKIE
NAMED “FIRSTNAME" AND DISPLAY IT
ON A PAGE:
<%
fname=Request.Cookies("firstname")
response.write("Firstname=" &
fname)
%>
Communication With User
Form
 Forms   are a convenient way to communicate with
  visitors to your Web site.
 A form on a page allows a user to enter data that
  is sent to a server for processing
 The  <form> tag is used to create an HTML
  form for user input.
 A form can contain input elements like text
  fields, checkboxes, radio-buttons, submit
  buttons and more. A form can also contain
  dropdown list, textarea elements.
 Forms are used to pass data to a server.
Attributes oF Form

 Action = Specifies where to send the form-data when a
  form is submitted
 Value =“url”

 Method = Specifies how to send form-data

 Value = “get or post”

 Name = Specifies the name for a form
Controls

 Users interact with forms through named
  controls.
 Each control has both an initial value and a
  current value, both of which are character
  strings.
Control types

 The Input Element
 The most important form element is the input
  element.
 The input element is used to select user
  information.
 An input element can vary in many ways,
  depending on the type attribute. An input
  element can be of type text field, checkbox,
  password, radio button, submit button, and
  more.
Attributes oF
input element
 Text Fields
 <input type="text">
 defines a one-line input field that a user can
  enter text into it.
 E.G.
 <form>
  First name: <input type="text"
  name="firstname">
  Last name: <input type="text"
  name="lastname">
  </form>
   Password Field
   <input type="password">
   defines a password field:
   E.G.
   <form>
    Password: <input type="password"
    name="pwd" />
    </form>
 Radio Buttons
 <input type="radio">

 defines a radio button. Radio buttons let a user select
  ONLY ONE one of a limited number of choices:
 E.G

 <form>
  <input type="radio" name="sex" value="male"> Male
  <input type="radio" name="sex" value="female"> Female
  </form>
 Checkboxes
 <input type="checkbox">
 defines a checkbox. Checkboxes let a user
  select ONE or MORE options of a limited
  number of choices.
 E.G.
 <form>
  <input type="checkbox" name="v1"
  value="Bike" /> I have a bike<br />
  <input type="checkbox" name="v2"
  value="Car" /> I have a car
  </form>
   Submit Button
   <input type="submit">
    defines a submit button.
   A submit button is used to send form data to a server. The
    data is sent to the page specified in the form's action
    attribute. The file defined in the action attribute usually does
    something with the received input:
   <form      name="input"       action=“a.asp"      method="get">
    Username:        <input     type="text"      name="user"      />
    <input         type="submit"           value="Submit"         />
    </form>
Pull down Lists: It is used to select one choice out of many
  choices. This control is very useful when we have number of
  choices and we have to choose only one particular choice.
  These lists occupy minimum amount of space. We use the
  <select> tag for this.
      Syntax
      <select name=”unique_name” size=”n”>
      <option value=”any_value”>
      <option value=”any_value ”>
      </select>
   <html>
    <head><title>Asking for information</title></head>
    <body>
    <form method="post" action="form_response.asp">
    Your name: <input type="text" name="name"
    size="20"><BR>
    Your email: <input type="password" name="email"
    size="15"><BR>
    <input type="Submit" value="Submit">
    </form>
    </body>
    </html>
 <html>
 <head><title>Responding to a form</title></head>
 <body>
 Your name is <% =Request.Form("name") %> <BR>
 Your email is <% =Request.Form("email") %>
 </body>
 </html>
The Response object is used to send the output back
to the client (browser). It includes all the HTTP
variables, cookies that will be stored on the client
browser and other info about the content being
sent.
Redirect Redirects the browser to another
         page (URLe.g.Response.Redirect
     "http://www.gurchet.orgfree.com".

Write   Writes the specified string to the
    web page e.g. Response.Write
 "Hello World!".
The Request object makes available all the values that
 client browser passes to the server during an HTTP
 request. It includes client browser info, cookie details ( of
 this domain only ), client certificates ( if accessing
 through SSL ) etc.
Form
              Collection of all the values of
                                  Form element in the HTTP
  request.


QueryString

  Collection of variables which are stored in the HTTP query
  string. Name / value pairs can also be appended to the URL
  after the end of page name e.g.
  "http://www.stardeveloper.com/asp_request.asp?
  author=Faisal+Khan" contains one variable 'author' with a
  value of 'Faisal Khan'.
Caching is a well known concept in computer science:
when programs continually access the same set of
instructions, a massive performance benefit can be
realized by storing those instructions in RAM.
 This prevents the program from having to access the
disk thousands or even millions of times during execution
 by quickly retrieving them from RAM. Caching on the
 web is similar in that it avoids a roundtrip to the origin
web server each time a resource is requested and
instead retrieves the file from a local computer's browser
cache or a proxy cache closer to the user.
The Buffer property specifies whether to buffer
the output or not. When the output is buffered, the
server will hold back the response to the browser
until all of the server scripts have been
processed, or until the script calls the Flush or
End method.

Note: If this property is set, it should be before
the <html> tag in the .asp file



                             response.Buffer[=flag]
Response.clear
Response.Flush
Response.End
For Communicating With User We Use Forms
   In Form We Have Two Method For
     Communicating User
1.   Method Post
2.   Method Get

Form tag provide various form fields for sending
   information to server. And we use these fields
   to communicating. Like text field to send mails
Another <form> tag attribute specifies how the
information will be sent to wherever it's going. That's the
"method" attribute. The method attribute is either
method="POST"
or
method="GET"
Which you use depends on how the destination program
or function wants to receive the information.
Sending With Method GET
 method="GET" is used if you want to send
 information somewhere via a browser URL.
 You've seen URLs that send information; they
 look something like:
http://gurchet.orgfree.com/handler.name?
 color=red&shape=round
 In the above URL, the part after the question
 mark is information sent to handler.name.
 Multiple information chunks are separated with
 an ampersand. The GET method can send only a
 limited amount of information. The limitation
 depends on the server where the current web
 page is on and the server where the information
 is sent to. The limitation can be as little as 256
 bytes but is often 1k or more.
Sending With Method POST
method="POST" is the most common method
used to send information from a form to an
information processing program or function.
This is the method used when sending form
information to JavaScript functions. Most CGI
programs are written to accept information with
the POST method, some to accept only the
POST
method. The POST method can send much more
information than the typical GET method.
Currently, most browsers and servers limit the
amount of POST information to about 32k. With
POST, the information is not sent via the URL.
The sending is invisible to the site visitor.
Accessing the HTTP Headers
Standard HTTP Headers
Environment Variables
 Using Cookies
Advantages & disadvantages cookies
When the client request a web page from the server it
 not only sends the url of web page requested but also
 send some additional information this extra
 information consists of useful facts about the client

1. What browser is being used
2. What operating system the client running
3. What url the user just come from

These information are called request header
Request Header is a single line of text that your
browser sends to the web Server when requesting to
view any web page.
Response Header when the server sends back the
requested web page to the client it also sends a set
of headers known as response headers.

Both request headers and response headers are
called HTTP Header
An HTTP Header is a single piece of information
sent either from client To the server when
requesting a page or from the server to the client
when Responding to a page request.




            1.   HTTP_ACCEPT
            2.   HTTP_ACCEPT_LANGAGUE
            3.   HTTP_CONNECTION
            4.   HTTP_HOST
            5.   HTTP_USER_AGENT
            6.   HTTP_REFERER
            7.   HTTP_COOKIE
The HTTP Headers are useful for obtaining
 information about current Visitor but tell you nothing
 about the web server or asp page that is being
 requested by the client. To obtain such information
 we use web server’s Environment Variables
  Environment Variables are bit of information that web
  browser make available to any Program that requested
  them.
            It contain information such as:-

1. Name of web server
2. url currently processing asp page
3. Name of software being used by web server.
1.   URL
                        2.   PATH_INFO
                        3.   PATH_TRANSLATED
                        4.   APPL_PHYSICAL_PATH
                        5.   QUERY_STRING
                        6.   SERVER_NAME
                        7.   SERVER_SOFTWARE


Many environment variables do not contain a value because it use when
required for example CERT Variable contains empty strings as their value.
This is because these variable are Used only when client and server use
CERTIFICATES .When a browser and web Server communicate over a
secure channel, certificates are used to ensure the identity of the Client to
the server.
Cookies are small amount of information stored in client
computer for some time.
When cookies are created on the client computer the developer
need to specify when they expire. After a cookie expire it will
automatically remove itself from the client computer.
Cookies created     response.cookies(“user”)=“John”
Cookies read        request.cookies(“user”)
Cookies expire      response.cookies(“user”).expires=date+10
1. Cookies stores on client computer so not need more space
   in web server
2. Save small amounts of information for very long periods of
   time
3. It is used to customize a user visit to your web site

1. User can choose not to accept cookies on their web
   browser
2. It not save large amount to date
3. It save only string, date or numeric date
4. It is not secure because if temp folder deleted it also
   delete all cookies
1. Web is stateless ?
2. Why to maintain state ?
3. Session Object
4. Asp application object
5. Asp global.asa file
6. Events in global.asa
An application is said to have state if it persists
 information for each user. In a web site this is not
the case for example if you fill out s form on A web
page and then revisit the form at some time later
the form fields will not contain The valued you entered
earlier because web site lack state this is called
stateless
For maintaining state asp provides many ways
these ways are used to kept information
Which is used in round tripping process.

In asp we have build in objects and collection for
maintaining state

Session object and application objects are used for
this purpose,
cookies are also used to Maintain state
PITFALLS OF SESSION VARIABLES
  (DRAWBACKS)

If user select that his system not save session then session not work
Default time is 20 minute it is also big disadvantages
The ASPError object, implemented in ASP 3.0, contains detailed information
about the last error that has occurred.
This information can only be accessed through the Server.GetLastError.
The ASPError object has nine read-only properties and no methods.
Properties
•ASP Code
This property returns the error code generated by IIS.
•Description
The description property returns the short description of the error.
•ASP Description
Returns a string that contains more detailed error information than the
 Description property, but it is not available for all errors.
There are 3 main types of errors:

Compile-time errors

These errors are usually in the syntax
of the code and stop the ASP from
compiling. You may have experienced
 this if you left the closing ”Next”
statement off of a “For” loop.
Runtime errors

These happen when you try to execute
 the ASP page. For example, if you try
setting a variable outside its allowed
 range.

Logic errors
Logic errors are harder to detect.
The problem lies within the structure of
the code, and the computer cannot detect
an error. These types require thorough
testing before rolling out the application.
5- invalid procedure call
6- overflow
7- out of memory
11- division by zero
13- type mismatch
53- internal error
61- disk full
76- path not found
438- object not support method or property
424- object required
<%

            On Error Resume Next
                  X = 15
                  Y=5
                  Z = 15

Response.Writes( X/Y & "<b><br>")
Response.Write( X/Z & "<b><br>")

      If Err.Number = 0 Then
              response.write("no error")
      else
              Response.Write(err.number & "<br>")
              Response.Write(err.description)
      End If
%>
Non Asp Error

Error Created By Server Is Called Non Asp Error
In This type Of Error Program Is Not Executated
Because Server Creates Problem.
Some Time Message Come – Server Not Exist Or
File Not Found
database:
A collection of related information stored
in a structured format.
Database is often used interchangeably
with the term table
A table is a single store of related
information; a database can consist of
one or more tables of information that are
related in some way.
data entry:
 The process of getting information into a
database, usually done by people typing
it in by way of data-entry forms designed
 to simplify the process.
dbms: Database management system.
A program which lets you manage
 information in databases.
Lotus Approach, Microsoft Access and
FileMaker Pro, for example, are all DBMSs,
although the term is often shortened to
'database'. So, the same term is used to
apply to the program you use to
organise your data and the actual
data structure you create with that program.
field:
Fields describe a single aspect of
each member of a table.
A student record, for instance, might
contain a last name field, a first name field,
a date of birth field and so on. All records
have exactly the same structure, so they
contain the same fields. The values in each
field vary from record to record, of course.
In some database systems, you'll find fields
referred to as attributes.
flat file:
A database that consists of a single table.
 Lightweight database programs such as
the database component in Microsoft Works
are sometimes called 'flat-file managers‘
 (or list managers) because they can only
handle single-table databases. More powerful
 programs, such as FileMaker Pro, Access,
Approach and Paradox, can handle
multi-table databases, and are
called relational database managers,
or RDBMSs.
primary key:
 A field that uniquely identifies a record in
a table. In a students table, for instance,
a key built from last name + first name
might not give you a unique identifier
 (two or more Jane Does in the school,
for example). To uniquely identify each
student, you might add a special Student
ID field to be used as the primary key.
foreign key:
A key used in one table to represent the
value of a primary key in a related table.
While primary keys must contain unique
values, foreign keys may have duplicates.
For instance, if we use student ID as the
primary key in a Students table
(each student has a unique ID),
we could use student ID as a foreign key
in a Courses table: as each student may
do more than one course,
index:
A summary table which lets you quickly look
up the contents of any record in a table.
Think of how you use an index to a book:
as a quick jumping off point to finding full
 information about a subject. A database
index works in a similar way. You can create
 an index on any field in a table
SQL: Structured Query Language
 (pronounced sequel
in the US; ess-queue-ell elsewhere).
 A computer language designed to organize
and simplify the process of getting information
out of a database in a usable form, and also
used to reorganize data within databases.
SQL is most often used on larger databases
on minicomputers, mainframes and
corporate servers.
query:
A view of your data showing information
from one or more tables. For instance,
using the sample database we used when
describing normalisation, you could query
the Students database asking "Show me the
first and last names of the students
Whose roll no is 90821.
RDBMS: Relational database management
system.
A program which lets you manage
structured information
stored in tables and which can
handle databases
consisting of multiple tables.
RECORD:
A record contains all the information
about a single 'member' of a table. In a
students table, each student's details
(name, date of birth, contact details,
and so on) will be contained in its own
record.
RELATIONAL DATABASE:
A database consisting of more than
one table. In a multi-table database,
you not only need to define the structure
of each table, you also need to define
the relationships between each table
in order to link those tables correctly.
REPORT:
A form designed to print information from a
database (either on the screen, to a file or
directly to the printer).
TABLE: A single store of related information.
 A table consists of records, and each
record is made up of a number of fields.
Just to totally confuse things, tables are
 sometimes called relations. You can think
of the phone book as a table: It contains a
 record for each telephone subscriber, and
 each subscriber's details are contained
in three fields - name, address and telephone.
Dr. E.F. Codd, an IBM researcher,
first developed the relational data model in 1970.
In 1985, Dr. Codd published a list of 12 rules that
 concisely define an ideal relational database,
which have provided a guideline for the design
 of all relational database systems ever since.
Rule 1: The Information Rule
        All data should be presented to the
        user in table form


Rule 2: Guaranteed Access Rule
All data should be accessible without
Ambiguity (doubt). This can be accomplished
through a combination of the table name,
primary key, and column name.
Rule 3:
Systematic Treatment of Null Values
A field should be allowed to remain empty.
 This involves the support of a null value,
 which is distinct from an empty string
or a number with a value of zero. Of course,
 this can't apply to primary keys. In addition,
 most database implementations support the
 concept of a nun- null field constraint that
prevents null values in a specific table column.
Rule 4:
Dynamic On-Line Catalog Based on the
Relational Model

A relational database must provide access
 to its structure through the same tools that
 are used to access the data. This is usually
accomplished by storing the structure definition
 within special system tables.
Rule 5:
Comprehensive Data Sublanguage Rule
The database must support at least one
 clearly defined language that includes
functionality for data definition, data
manipulation, data integrity, and database
transaction control. All commercial
relational databases use forms of the
standard SQL (Structured Query Language)
as their supported comprehensive language.
Rule 6: View Updating Rule
Data can be presented to the user in different
 logical combinations, called views. Each
view should support the same full range
of data manipulation that direct-access
 to a table has available. In practice,
 providing update and delete access to
 logical views is difficult and is not fully
 supported by any current database.
Rule 7:
High-level Insert, Update, and Delete
Data can be retrieved from a relational
database in sets constructed of data
from multiple rows and/or multiple tables.
This rule states that insert, update, and delete
 operations should be supported for any
retrievable set rather than just for a single
row in a single table
Rule 8: Physical Data Independence
The user is isolated from the physical
method of storing and retrieving information
from the database. Changes can be made
to the underlying architecture
( hardware, disk storage methods )
without affecting how the user accesses it.
Rule 9: Logical Data Independence
How a user views data should not change
when the logical structure (tables structure)
of the database changes. This rule is particularly
 difficult to satisfy. Most databases rely on strong
 ties between the user view of the data and the
actual structure of the underlying tables.
Rule 10: Integrity Independence
The database language (like SQL)
should support constraints on user input
that maintain database integrity. This
rule is not fully implemented by most
major vendors. At a minimum, all
databases do preserve two constraints
through SQL.
No component of a primary key can
have a null value. (see rule 3)
If a foreign key is defined in one table,
 any value in it must exist as a primary
 key in another table.
Rule 11: Distribution Independence
A user should be totally unaware of whether
or not the database is distributed (whether parts
of the database exist in multiple locations).
 A variety of reasons make this rule difficult to
 implement;
Rule 12: Nonsubversion Rule
There should be no way to modify the
database structure other than through the
multiple row database language (like SQL).
Most databases today support administrative
tools that allow some direct manipulation of
the datastructure.
1.What is ADO?
ADO is a Microsoft technology
ADO stands for ActiveX Data Objects
ADO is a Microsoft Active-X component
ADO is automatically installed with
Microsoft IIS
ADO is a programming interface to access
data in a database
2.Accessing a Database from an ASP Page
The common way to access a database from
inside an ASP page is to:
Create an ADO connection to a database
Open the database connection
Create an ADO recordset
Open the recordset
Extract the data you need from the recordset
Close the recordset
Close the connection
3. How DSN-less Database Connection Created ?

The easiest way to connect to a database is to use
 a DSN-less connection. A DSN-less connection can be
used against any Microsoft Access database on your
web site.
If you have a database called "northwind.mdb" located
 in a web directory like "c:/webdata/",
you can connect to the database with the following
ASP code:
<%
 set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0“
conn.Open "c:/webdata/northwind.mdb"
%>
4. What is Connection Object ?
The ADO Connection Object is used to create
an open connection to a data source. Through
this connection,you can access and manipulate
a database.If you want to access a database
multiple times,you should establish a
connection using the Connection object. You
can also make a connection to a database by
passing a connection string via a Command or
Recordset object. However,this type of
connection is only good for one specific, single
query.
set objConnection=Server.CreateObject("ADODB.connection")
5. What is Recordset Object ?

The ADO Recordset object is used to hold a set of records
 from a database table. A Recordset object consist of
records and columns (fields).

In ADO, this object is the most important and the one
used most often to manipulate data from a database.

set objRecordset=Server.CreateObject("ADODB.recordset")
7. How Data is Extracted from Record set

  After a record set is opened, we can extract data from
  record set.
  Suppose we have a database named "North wind",
  we can get access to the
  "Customers" table inside the database
<%
dim con
set con=Server.createObject("ADODB.connection")
con.open "provider=microsoft.jet.oledb.4.0;Data source="& server.
mappath("db1.mdb")
set rs=Server.createObject("ADODB.Recordset")
q="select * from stu"
rs.open q,con
response.write("<table border=3 align=center height=30% width=20% >
"&"<tr><th>")
response.write("ID" & "</td><td>" & "<b> Name"& "</td><td>" & "<b>
Marks")
response.write("</td></tr>")
response.write("<br>")
do while not rs.EOF
response.write("<tr><td>")
response.write(rs("id")&" " & "</td><td>")
response.write(rs("name")&" " & "</td><td>")
response.write(rs("marks")&" " & "</td>")
response.write("<br>")
response.write("</tr>")
rs.movenext
loop
%>
 Recordset Object
 The ADO Recordset object is used to hold a set of records
  from a database table. A Recordset object consist of
  records and columns (fields).
 In ADO, this object is the most important and the one
  used most often to manipulate data from a database.
What is Recordset updating:
Immediate updating - all changes are
written immediately to the database
 once you call the Update method.

Batch updating - the provider will cache
multiple changes and then send them
to the database with the Update
Batch method.
12. Define 4 different types of cursor in ADO

Cursor:
Database cursor is a control structure that enables traversal
over the records in a database. Cursors are used by database
programmers to process individual rows returned by database
system queries.

Types Of Cursor
Dynamic cursor –
Allows you to see additions, changes,
and deletions by other users.

Keyset cursor –
 Like a dynamic cursor, except that you cannot
see additions by other users, and it prevents access
to records that other users have deleted.
Static cursor
Provides a static copy of a recordset for you to
use to find data or generate reports. Static cursors
Support scrolling backward and forward, but they
do not support updates.This is the only type of cursor
allowed when you open a client-side Recordset object.
The following is an example of how to obtain a static
cursor by using ADO.NET:
cmd.CommandText = "Select * from tablename";
SqlCeResultSet rs = cmd.ExecuteResultSet
(ResultSetOptions.Scrollable | ResultSetOptions.
Insensitive);
Forward-only cursor

-Allows you to only scroll forward through the
Recordset.
-Additions, changes, or deletions by other users will
not be visible.

Popular Relational Database Product

SQL 7
ORACLE8
SYSBASE
IBM’S DB2
INFORMIX
Learn ASP

More Related Content

What's hot (20)

Std 10 Computer Chapter 3 Handling Images in HTML (Part 1)
Std 10 Computer Chapter 3 Handling Images in HTML (Part 1)Std 10 Computer Chapter 3 Handling Images in HTML (Part 1)
Std 10 Computer Chapter 3 Handling Images in HTML (Part 1)
 
Aula 01 - JavaScript: Introdução
Aula 01 - JavaScript: IntroduçãoAula 01 - JavaScript: Introdução
Aula 01 - JavaScript: Introdução
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Xml parsers
Xml parsersXml parsers
Xml parsers
 
Images and Lists in HTML
Images and Lists in HTMLImages and Lists in HTML
Images and Lists in HTML
 
Html forms
Html formsHtml forms
Html forms
 
Android media codec 사용하기
Android media codec 사용하기Android media codec 사용하기
Android media codec 사용하기
 
Javascript basics
Javascript basicsJavascript basics
Javascript basics
 
Css
CssCss
Css
 
Common Gateway Interface
Common Gateway InterfaceCommon Gateway Interface
Common Gateway Interface
 
Basic html
Basic htmlBasic html
Basic html
 
Html images
Html imagesHtml images
Html images
 
Html form tag
Html form tagHtml form tag
Html form tag
 
HTML Frameset & Inline Frame
HTML Frameset & Inline FrameHTML Frameset & Inline Frame
HTML Frameset & Inline Frame
 
Dhtml ppt (2)
Dhtml ppt (2)Dhtml ppt (2)
Dhtml ppt (2)
 
DOMinando JavaScript
DOMinando JavaScriptDOMinando JavaScript
DOMinando JavaScript
 
Css colors
Css   colorsCss   colors
Css colors
 
Php session
Php sessionPhp session
Php session
 
An Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java ScriptAn Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java Script
 
Aula javascript
Aula  javascriptAula  javascript
Aula javascript
 

Viewers also liked

Introduction to Asp.net 3.5 using VS 2008
Introduction to Asp.net 3.5 using VS 2008Introduction to Asp.net 3.5 using VS 2008
Introduction to Asp.net 3.5 using VS 2008maddinapudi
 
Module 4: Introduction to ASP.NET 3.5 (Material)
Module 4: Introduction to ASP.NET 3.5 (Material)Module 4: Introduction to ASP.NET 3.5 (Material)
Module 4: Introduction to ASP.NET 3.5 (Material)Mohamed Saleh
 
Asp.net Training at NCrypted Learning Center
Asp.net Training at NCrypted Learning CenterAsp.net Training at NCrypted Learning Center
Asp.net Training at NCrypted Learning CenterNCrypted Learning Center
 
Module 4: Introduction to ASP.NET 3.5 (PowerPoint Slides)
Module 4: Introduction to ASP.NET 3.5 (PowerPoint Slides)Module 4: Introduction to ASP.NET 3.5 (PowerPoint Slides)
Module 4: Introduction to ASP.NET 3.5 (PowerPoint Slides)Mohamed Saleh
 
Antimicrobial stewardship(asp)and mdr
Antimicrobial stewardship(asp)and mdrAntimicrobial stewardship(asp)and mdr
Antimicrobial stewardship(asp)and mdrDel Del
 
Intro To Asp Net And Web Forms
Intro To Asp Net And Web FormsIntro To Asp Net And Web Forms
Intro To Asp Net And Web FormsSAMIR BHOGAYTA
 
Basic vbscript for qtp
Basic vbscript for qtpBasic vbscript for qtp
Basic vbscript for qtpCuong Tran Van
 
Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Jeff Blankenburg
 
ASP.NET with VB.NET
 ASP.NET with VB.NET ASP.NET with VB.NET
ASP.NET with VB.NETShyam Sir
 
Basic Concept of ASP.NET
Basic Concept of ASP.NETBasic Concept of ASP.NET
Basic Concept of ASP.NETShyam Sir
 
CoffeeScript com Visual Studio e ASP.NET MVC
CoffeeScript com Visual Studio e ASP.NET MVCCoffeeScript com Visual Studio e ASP.NET MVC
CoffeeScript com Visual Studio e ASP.NET MVCGiovanni Bassi
 
Case Study of Mumbai Dabbawala system-On time delivery Every Time
Case Study of Mumbai Dabbawala system-On time delivery Every TimeCase Study of Mumbai Dabbawala system-On time delivery Every Time
Case Study of Mumbai Dabbawala system-On time delivery Every TimeSandeep Patel
 

Viewers also liked (17)

Introduction to Asp.net 3.5 using VS 2008
Introduction to Asp.net 3.5 using VS 2008Introduction to Asp.net 3.5 using VS 2008
Introduction to Asp.net 3.5 using VS 2008
 
Asp.net Mvc 5 y Azure
Asp.net Mvc 5 y AzureAsp.net Mvc 5 y Azure
Asp.net Mvc 5 y Azure
 
Module 4: Introduction to ASP.NET 3.5 (Material)
Module 4: Introduction to ASP.NET 3.5 (Material)Module 4: Introduction to ASP.NET 3.5 (Material)
Module 4: Introduction to ASP.NET 3.5 (Material)
 
Asp.net Training at NCrypted Learning Center
Asp.net Training at NCrypted Learning CenterAsp.net Training at NCrypted Learning Center
Asp.net Training at NCrypted Learning Center
 
Module 4: Introduction to ASP.NET 3.5 (PowerPoint Slides)
Module 4: Introduction to ASP.NET 3.5 (PowerPoint Slides)Module 4: Introduction to ASP.NET 3.5 (PowerPoint Slides)
Module 4: Introduction to ASP.NET 3.5 (PowerPoint Slides)
 
Antimicrobial stewardship(asp)and mdr
Antimicrobial stewardship(asp)and mdrAntimicrobial stewardship(asp)and mdr
Antimicrobial stewardship(asp)and mdr
 
Intro To Asp Net And Web Forms
Intro To Asp Net And Web FormsIntro To Asp Net And Web Forms
Intro To Asp Net And Web Forms
 
Real-time ASP.NET with SignalR
Real-time ASP.NET with SignalRReal-time ASP.NET with SignalR
Real-time ASP.NET with SignalR
 
Basic vbscript for qtp
Basic vbscript for qtpBasic vbscript for qtp
Basic vbscript for qtp
 
Arduino Workshop Day 2
Arduino  Workshop Day 2Arduino  Workshop Day 2
Arduino Workshop Day 2
 
Asp.net orientation
Asp.net orientationAsp.net orientation
Asp.net orientation
 
Presentation on mumbai dabbawala
Presentation on mumbai dabbawalaPresentation on mumbai dabbawala
Presentation on mumbai dabbawala
 
Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5
 
ASP.NET with VB.NET
 ASP.NET with VB.NET ASP.NET with VB.NET
ASP.NET with VB.NET
 
Basic Concept of ASP.NET
Basic Concept of ASP.NETBasic Concept of ASP.NET
Basic Concept of ASP.NET
 
CoffeeScript com Visual Studio e ASP.NET MVC
CoffeeScript com Visual Studio e ASP.NET MVCCoffeeScript com Visual Studio e ASP.NET MVC
CoffeeScript com Visual Studio e ASP.NET MVC
 
Case Study of Mumbai Dabbawala system-On time delivery Every Time
Case Study of Mumbai Dabbawala system-On time delivery Every TimeCase Study of Mumbai Dabbawala system-On time delivery Every Time
Case Study of Mumbai Dabbawala system-On time delivery Every Time
 

Similar to Learn ASP (20)

Introduction to asp
Introduction to aspIntroduction to asp
Introduction to asp
 
Asp.netrole
Asp.netroleAsp.netrole
Asp.netrole
 
Opr089 xx
Opr089 xxOpr089 xx
Opr089 xx
 
Rutgers - Active Server Pages
Rutgers - Active Server PagesRutgers - Active Server Pages
Rutgers - Active Server Pages
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.net
 
Asp.Net Tutorials
Asp.Net TutorialsAsp.Net Tutorials
Asp.Net Tutorials
 
Web tech
Web techWeb tech
Web tech
 
Web tech
Web techWeb tech
Web tech
 
Web tech
Web techWeb tech
Web tech
 
Web techh
Web techhWeb techh
Web techh
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
 
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.pptintroaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
 
introaspnet.ppt
introaspnet.pptintroaspnet.ppt
introaspnet.ppt
 
introaspnet.ppt
introaspnet.pptintroaspnet.ppt
introaspnet.ppt
 
Web server
Web serverWeb server
Web server
 
Asp.net architecture
Asp.net architectureAsp.net architecture
Asp.net architecture
 
Aspnet2.0 Introduction
Aspnet2.0 IntroductionAspnet2.0 Introduction
Aspnet2.0 Introduction
 
Introaspnet
IntroaspnetIntroaspnet
Introaspnet
 
Aspintro
AspintroAspintro
Aspintro
 

Recently uploaded

Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxleah joy valeriano
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsManeerUddin
 

Recently uploaded (20)

YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture hons
 

Learn ASP

  • 1.
  • 2.
  • 4. ASP developed in November 1996 by Microsoft. An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are executed on the server.
  • 5. 1. ASP stands for Active Server Pages 2. ASP is a program that runs inside IIS 3. IIS stands for Internet Information Services 4. IIS comes as a free component with Windows 2000 5. IIS is also a part of the Windows NT 4.0 Option Pack 6. The Option Pack can be downloaded from Microsoft 7. PWS is a smaller - but fully functional - version of IIS 8. PWS can be found on your Windows 95/98 CD
  • 6.
  • 7.
  • 8.
  • 9. • Dynamically edit, change or add any content of a Web page • Respond to user queries or data submitted from HTML forms • Access any data or databases and return the results to a browser
  • 10. • Customize a Web page to make it more useful for individual users • The advantages of using ASP instead of CGI and Perl, are those of simplicity and speed • Provide security since your ASP code can not be viewed from the browser • Clever ASP programming can minimize the network traffic
  • 11. ASP is a mixture of HTML and scripting that enables you to build dynamic and database- driven web sites. ASP is a server - side scripting environment that we can use to create and run dynamic, interactive, high - performance Web server applications."
  • 12. A server is a computer (Usually high-end, "Faster, Bigger") that allows computers in a network to have a shared resource. Most servers in the area are used to share files to run programs or to share Printers The different rolls that servers play in the area are:
  • 13. PDC (Primary Domain Controller) These servers are the bosses of 1 or more servers. All usernames and passwords are kept on the PDC. BDC (Backup Domain Controller) These servers are the backups which take over if the PDC fails. They keep a copy of the Usernames and Passwords to validate logons incase the PDC is busy. Server These servers are just ordinary servers that can join a domain but can not replace a PDC like a BDC. These servers usually are setup to just share files or printers.
  • 14. Print Server These servers are usually assigned network printers to share and maintain. File Servers These servers have folders/directories shared for access by network users. Application Servers These servers have programs that are shared across the network to multiple computers. A server can only be one of these but can be any combination of file, print, and application server
  • 15. A protocol is a set of rules that governs the communications between computers on a network. These rules include guidelines that regulate the following characteristics of a network access method, allowed physical space, types of cabling, and speed of data transfer. The most common protocols are: Ethernet Local Talk Token Ring FDDI ATM
  • 16. HTTP (Hypertext Transfer Protocol) is the set of rules for transferring files (text, graphic images, sound, video, and other multimedia files) on the World Wide Web. As soon as a Web user opens their Web browser, the user is indirectly making use of HTTP.
  • 17. PWS is for older Windows system like Windows 95, 98, and NT. PWS is easy to install and can be used for developing and testing web applications including ASP.
  • 18.
  • 19. Open the Add-ons folder on your Windows98 CD, find the PWS folder and run the setup.exe file. An Inetpub folder will be created on your hard drive. Open it and find the wwwroot folder. Create a new folder, like "MyWeb", under wwwroot. Use a text editor to write some ASP code, save the file as "test1.asp" in the "MyWeb" folder. Make sure your Web server is running – The installation program has added a new icon on your task bar this is the PWS symbol). Click on the icon and press the Start button in the window that appears. Open your browser and type in http://localhost/MyWeb/test1.asp", to view your first ASP page.
  • 20. Note: You cannot run ASP on Windows XP Home Edition. Insert the Windows XP Professional CD-Rom into your CD-Rom Drive From your Start Button, go to Settings, and Control Panel In the Control Panel window select Add/Remove Programs In the Add/Remove window select Add/Remove Windows Components In the Wizard window check Internet Information Services , click OK
  • 21. An Inetpub folder will be created on your hard drive Open the Inetpub folder, and find a folder named wwwroot Create a new folder , like "MyWeb", under wwwroot. Use a text editor to write some ASP code, save the file as "test1.asp" in the "MyWeb" folder Make sure your Web server is running - its status can be checked by going into the Control Panel, then Administrative Tools , and double-click the "IIS Manager" icon Open your browser and type in "http://localhost/MyWeb/test1.asp", to view your first ASP page
  • 22. Client/server model is a concept for describing communications between computing processes that are classified as service consumers (clients) and service providers (servers).
  • 23. Client/server describes the relationship between two computer programs in which one program, the client, makes a service request from another program, the server, which fulfills the request
  • 24. Request client server Response
  • 25. A scripting language has a particular syntax used to execute commands on a computer. A program composed of commands from a particular scripting language is referred to as a script.
  • 26. The client, processes client side script. It is the client’s responsibility to execute all Client-Side scripts. Client side scripting is programmatic code in an HTML file that runs on the browser. It is denoted by the <Script> tag. It is commonly written using JavaScript Programming language due to the fact that Netscape support JavaScript language for client-side scripting.
  • 27. Server-side scripts are processed completely on the web server. The client does not receive any code from server-side scripts; rather, the client receives just the output of the server-side scripts. Client-side scripts and server side scripts cannot interact with one another because the client – side scripts are executed on the client, after the server-side scripts have finished processing completely. ASP script is a server side scripting.
  • 28. In order to activate ASP components and to use its objects, a script is placed on the Web page along with the HTML codes specifying how the generated information is to be formatted for display in the browser. This script is written in the VBScript language and is contained inside the special symbols <% and %> to indicate its presence to the server:
  • 29. <% This is a script %>
  • 30. After you have installed IIS or PWS follow these steps: 1. Look for a new folder called Inetpub on your hard drive 2.Open the Inetpub folder, and find a folder named wwwroot
  • 31. 3. Write some ASP code and save the file as “first.asp" in the new folder 4. Make sure your Web server is running
  • 32. 6. Open your browser and type "http://localhost/first.asp", to view your first web page
  • 33. Response.write command is just like the printf command in C. The response.write command is used to write output to a browser. The following example sends the text “My First ASP Program !" to the browser:
  • 34. <html> <head> <title>First ASP Program</title> </head> <body> <% response.write(“My First ASP Program !") %> </body> </html>
  • 35. <% response.write "Hello ASP World<br>" response.write "Today is " & Date response.write " and the time is " & Time %>
  • 36. ASP uses VBScript as its default programming language. This means VBScript comments are ASP comments. That means there isn't any support for multiple line comments that you see in HTML and various other programming languages.
  • 37. To create comment in ASP you simply place an apostrophe ‘ in front of what you want to make a comment.  <%  ‘This is a comment  Response.write(“this is a comment”)  %>
  • 38. When the server invokes the ASP scripting engine, it parse the file and inserts any include files. It then collects the script portion by finding all the script delimiter.The ASP treats all non-script contents as strings that it writes verbatim(Exactly) back to the client. Next the scripting engine creates variables and external components invoked by the script. Finally it begins the script executing each command and sending results to the client.
  • 39. Request ASP.DLL ASP Scripting Engine Response HTML Coding Processing Client Server
  • 40. The process of ASP script is goes through these five stages 1. Request: The web browser contacts the server and tells it what page it wants to see 2. Pre-processing : The asp.dill file does some initial processing on the requested script. 3. Execution : The scripting engine executes the instructions in the script 4. Translate: ASP translate the result of the execution into HTML 5. Display: The HTML is sent back to the browser,which process the tags and display it.
  • 41.
  • 42. •A variable is used to store information for later use. •ASP is not a language in itself. To program ASP you actually need to know the VBScript scripting language. This means that all VBScript variable rules can be applied to your ASP code. •In ASP you declare a variable with the use of the Dim keyword, which is short for Dimension. •(Dimension in English refers to the amount of space something takes up in the real world, but in computer terms it refers to space in computer memory.)
  • 43.  The value of each variable is held in the server's memory, so the value of the variable can be manipulated or displayed as needed within a page.  In VBScript, there is only one data type, and that is variant.  A variant can hold either strings or numbers, and will behave as a number if its numeric, and as a string for string values.  In ASP, it is not necessary to declare your variables before using them.  If, however, you choose to do so, you use the DIM statement
  • 44.  ASP Variable Naming Conventions  Once again, ASP uses VBScript by default and so it also uses VBScripts variable naming conventions. These rules are: 1. Variable name must start with an alphabetic character (A through Z or a through z) 2. Variables cannot contain a period 3. Variables cannot be longer than 255 characters (don't think that'll be a problem!) 4. Variables must be unique in the scope in which it is declared.
  • 45. Assigning values in ASP is straightforward enough, just use the equals "=" operator. Ahead we have set a variable equal to a number and a separate variable equal to a string.
  • 46. A variable declared outside a procedure can be accessed and changed by any script in the ASP file.  A variable declared inside a procedure is created and destroyed every time the procedure is executed. No scripts outside the procedure can access or change the variable.  To declare variables accessible to more than one ASP file, declare them as session variables or application variables.
  • 47.  Session Variables  Sessionvariables are used to store information about ONE single user, and are available to all pages in one application. Typically information stored in session variables are name, id, and preferences.  Application Variables  Application variables are also available to all pages in one application. Application variables are used to store information about ALL users in one specific application.
  • 48. <% ' Note that lines starting with a single quote are comments. ' Commented lines are not executed. ' First, declare variables using Dim. This is optional Dim a, b, c, d, e, f a=1 b=2 c= a + b d="The value of " e=" plus " f=" equals " response.write (d & a & e & b & f & c) %> The script output is: The value of 1 plus 2 equals 3
  • 49. <html> <body> <% dim name name=" Mickey Mouse " response .write ("My name is: " & name) %> </body> </html>
  • 50.
  • 51.
  • 52. Comparison operators are used when you want to compare two values to make a decision. Comparison operators are most commonly used in conjunction with "If...Then" and "While statements, otherwise known as conditional statements. The items that are most often compared are numbers. The result of a comparison operator is either TRUE or FALSE.
  • 53.
  • 54. A logical operator is used for complex statements that must make decisions based on one or more of these truth values.
  • 55. The only string operator is the string concatenation operator "&" that takes two strings and join them together to form a new string. An example would be string1 = "Tim" and string2 = " is a Hero". The following code would combine these two strings into one: string3 = string1 & string2
  • 56.
  • 57. A control structure is a programming structure that allows your program to make decisions. Types of controls There are three major types of controls structures 1. Conditional logic 2. Looping logic 3. Branching logic
  • 58. Conditional logic allows you to match condition if condition matches then result come if condition not matches result not come Example In job selection form if age is less then 27 then you can fill form or if age is more then 27 then you are not eligible for this job.
  • 59.
  • 60. <% Dim Result Result = 70 if Result >= 57 then response.write("Pass") else response.write("Fail") end if %>
  • 61. <% Dim Result Result = 70 if Result >= 75 then response.write("Passed: Grade A ") elseif Result >= 60 then response.write("Passed: Grade B ") elseif Result >= 45 then response.write("Passed: Grade C ") else response.write("Failed ") end if %>
  • 62. <%@ language="vbscript“%> <% Dim Flower Flower = "rose" select case flower case "rose" response.write(flower & " costs 20rs") case "daisy" response.write(flower & " costs 15rs") case "orchild" response.write(flower & " costs 12rs") case else response.write("There is no such flower in our shop") end select %>
  • 63.
  • 64. ASP performs several types of repetitive operations, called "looping". Loops are set of instructions used to repeat the same block of code till a specified condition returns false or true depending on how you need it. To control the loops you can use counter variable that increments or decrements with each repetition of the loop.
  • 65.
  • 66. <%@ language="vbscript" %> <% For i = 0 to 10 response.write("The number is " & i & "<br>") Next %>
  • 67. <%@ language="vbscript" %> <% response.write("<h1>Multiplication table</h1>") response.write("<table border=2 width=50>") Dim i For i=1 to 10 response.write("<tr>") response.write("<td>"& i &"</td>") Dim j For j=2 to 43 response.write("<td>"&i * j &"</td>") Next response.write("</tr>") Next response.write("</table>") %>
  • 68. <% Dim i i=0 Do While i<=10 response. write( i & "<br>") i=i+1 Loop %>
  • 69. <% a=1 Do while a < 11 response.write "This is loop " & a & "<br>" a=a+1 Loop %> <% a=1 Do until a = 11 response.write "This is loop " & a & "<br>" a=a+1 Loop %>
  • 70. <% a=1 Do until a = 11 If a < 6 then response.write "This is loop " & a & "<br>" a=a+1 Else Exit Do End If Loop %>
  • 71.
  • 72. The branch logic control refers to the process of leaving the current flow of the program to a new set of instructions. There are two types of branching logic controls: subroutines (procedure) and functions. The subroutines perform actions and functions compute values. We first start with subroutines.
  • 73. Subroutines are used to perform an action. An example of action might be to print a message to the screen. When calling a VBScript or a JavaScript procedure from an ASP file written in VBScript, you can use the "call" keyword followed by the procedure name.
  • 74.  Functions are written to perform calculations. Like subroutines, functions can take one or more arguments. Functions can also return one value.  A function begins with the keyword function and ends with the keyword END FUNCTION.  FUNCTION AbValue (inNo) If inNo < 0 then inNo = - inNo  END IF AbValue = inNo  END FUNCTION  The value that is returned by a function can be printed or assigned to another variable for later use in the program.
  • 75. Functions and sub procedures have many similarities: • They can be called or invoked from anywhere within your script. •A function or sub procedure can be reused as many times as required, thus saving you time writing out repetitive code Both are blocks of self contained code that can accept arguments. •Both will only run when called or invoked from code elsewhere and will not run automatically when the page is loaded. The difference between a function and a sub is that a sub will do some stuff (like printing something to the screen) and then quit, while a function runs some code and then returns the result back to the code that called it. •A Function could be used to do a calculation and then return a result.
  • 76. Insert the <%@ language="language" %> line above the <html> tag to write the procedure/function in another scripting language: <%@ language="javascript" %> <%@ language=“vbscript" %>
  • 77. <html> <head> <% sub name() response.write (“My name is Hunter") end sub %> </head><body> <% response.write(“Welcome today is Monday") response.write("<br>") call name response.write("<br>") response.write("thanks") %> </body></html>
  • 78. <html><head> <% function sum (x,y) sum=x+y end function %> </head><body> <% dim x,y,z x=20 y=40 z=sum(x,y) response.write ("sum is " & z) %> </body></html>
  • 79. Vb Scri pt arra y is 0 base d, mea ning that the arra y elem ent inde
  • 80. static array remains with fixed size throughout their life open. To use static array you need to know upfront the maximum number of the elements this array will contain. If you need more flexible vb script array with variable index size, then you can use dynamic array. Dynamic array index size can be increased/decreased during their life span.
  • 81.  Create static array called “arrcar” that will hold the name of five cars.  <%  Dim arrcar  arrcar=Array("Audi","Honda city","Mercedes","Safari","Bentley")  For I=0 to 4  Response.write arrcar(i) & "<br>"  Next  %>
  • 82. Dynamic array comes in handy (Versatile) when you aren’t sure how many items your array will hold. To create a dynamic array you should use the dim statement along with the array’s name, within specifying upper bound. <% dim arrcar arrcar=array() %> In order to use this array you need to use the ReDim statement to define the array’s upper bound:
  • 83.  Dim arrcar  arrcar=Array()  Redim arrcar(27)  If in future you need to resize this array, you should use the redim statement again. Be very careful with the redim statement. When you use the redim statement you lose all the element of the array. Using the keyword PRESERVE in conjunction with the redim statement will keep the array we already have and increase the size.
  • 84.  <%  Dim arrcar  Arrcar=array()  Redim arrcar(27)  Redim PRESERVE arrcar(52)  %>
  • 85.  <%  Dim arrcar  redim arrcar(3)  arrcar=Array("Audi","Honda city","Mercedes","Safari","Bentley","lemo","alto")  redim preserve arrcar(7)  For i=0 to 6  Response.write arrcar(i) & "<br>"  Next  %>
  • 86.  Array don’t have to be a simple list of keys and values, each location in the array can hold another array. The reason you may use this type of array is when you have records of each item.  For example car,year,price,…… and you want to display one record at a time. The most commonly used are two- dimensional arrays.You can thin of two dimensional array as a matrix, or grid , with width and height of rows and columns. Here is
  • 87.  how you could define two-dimensional array and display the array values on the web page.  <%  dim arrcar(2,4)  arrcar(0,0)="honda city"  arrcar(1,0)="2009"  arrcar(2,0)="859598"  arrcar(0,1)="audi"  arrcar(1,1)="2009"  arrcar(2,1)="450000"
  • 88.  arrcar(0,2)="honda city"  arrcar(1,2)="2009"  arrcar(2,2)="700000"  arrcar(0,3)="safri"  arrcar(1,3)="2009"  arrcar(2,3)="6,00000"  arrcar(0,4)="lemo"  arrcar(1,4)="2009"  arrcar(2,4)="990000"
  • 89.  response.write ("<table border=2>")  response.write ("<tr> <td>row</td><td>car</td> <td>year</td> <td>price</td> </tr>")  for i=0 to ubound (arrcar,2)  response.write ("<tr> <td>" & i & "</td>")  response.write("<td>" & arrcar (0,i) & "</td>")  response.write("<td>" & arrcar (1,i) & "</td>")  response.write("<td>" & arrcar (2,i) & "</td>")  next  response.write("</table>")  %>
  • 90.
  • 91.  dim a(1,1)  a(0,0)="HTML"  a(0,1)="Hyper Text Markup Language“  a(1,0)="ASP"  a(1,1)="Active Server Page“  for i=0 to ubound(a,1)  response.write("<table width=60% ><tr><td>")  response.write(a(0,i)& "</td><td>")  response.write(a(1,i)&"</td></tr>")  next  response.write("</table>")
  • 92.
  • 93. Vb script is client side script language and run on client side so we do not require server and asp. It is lighter because no load at server it completely run at client side because all codes written in html.
  • 94.
  • 95. Conversion of one data type to another is called type casting Cint Cdate Asc
  • 96. ASC  <%  response.write("ANSI code of a string is: " & asc("a"))  %>  Cdate  converts the date expression to the variant of subtype date  <%  a="march 14,1985"  response.write ("<br>" & cdate(a))  %>
  • 97. Cint  Converts an expression to a variant of subtype Integer.  <%  Response.write(Cint(2314.166))  %>
  • 98.
  • 99.  Date  <%  response.write("current date of the system:“ & date)  %>  Time  <%  response.write(“Current time of the system" & time)  %>  Day  <%  response.write(“day of the system: " &day(date))  %>
  • 100.  WeekDayName  <%  response.write(“Name of the weekday :" & weekdayname(1))  %>  WeekDay  <%  response.write("week day : " & weekday(date))  %>  Month  <%  response.write("<br> month" &month(date))  %>
  • 101. MonthName  response.write(“Name of the month“ & monthname(3))  Year  <%  response.write("year:“ & year(date))  %>
  • 102.  DateDiff  <%  response.write("day" & datediff("d",date,“01/01/2000"))  response.write("<br> Year" & datediff("yyyy",date," 01/01/2000"))  response.write("<br> month" & datediff("m",date," 01/01/2000"))  response.write("<br> Mintue" & datediff("n",date," 01/01/2000 "))  response.write("<br> hour" & datediff("h",date," 01/01/2000 "))  response.write("<br> second" & datediff("s",date," 01/01/2000"))  %>
  • 103.
  • 104. 1. Abs function  The Abs function returns the absolute value of a specified number.  Example  <%  Response.write (Abs(1) & “<br>”)  Response.write(Abs(-1))  %>
  • 105.  Cos Function  The cos function returns the cosine of a specified number.  <%  Response.write(cos(50.0))  %>
  • 106.  Exp Function  The Exp function returns e raised to a power.  <%  Response.write(exp(6.7))  %>  IntFunction  The int function returns the integer part of a number  <%  Response.write(int(6.83227))  %>
  • 107.  Sqr Function  The sqr function returns the square root of a number.  <%  Response.write(sqr(9))  %>  Tan Function  The tan function returns the tangent of a number < %  Response.write(tan(59))  %>
  • 108. The InStr function returns the position of the first occurrence of one string within another. <% dim a,b a="Have a Great Day Enjoy" b=instr(a,"Great") response.write(b) %> Output:8
  • 109. The InStrRev function returns the position of the first occurrence of one string within another. The search begins from the end of string, but the position returned counts from the beginning of the string <% dim a,b a="Have a Great Day Enjoy" b=instrrev(a,"Day") response.write(b) %> Output:14
  • 110. The LCase function converts a specified string to lowercase. dim a a=“HAVE A GREAT DAY!" response.write(LCase(a)) Output: have a great day!
  • 111. The Left function returns a specified number of characters from the left side of a string. dim a a="This is a beautiful day!" response.write(Left(a,11)) Output:This is a b
  • 112. The Len function returns the number of characters in a string. dim a a="This is a beautiful day!" response.write(Len(a)) Output:24
  • 113. The Mid function returns a specified number of characters from a string. <% dim a a="Have a Great Day Enjoy" b=mid(a,8,9) response.write(b) %> Output: Great Day
  • 114. The Replace function replaces a specified part of a string with another string a specified number of times dim a a="This is a beautiful day!" response.write(Replace(a,"beautiful","horrible")) Output:This is a horrible day!
  • 115. The String function returns a string that contains a repeating character of a specified length. response.write(String(10,"#")) Output:##########
  • 116.
  • 117. An object is a thing or an entity like pen, table, chair, mobile phone, car etc. in other words, an object is a reusable component that contains related data and functions that represent some real-life things.  A property is a basic characteristics of an object or you can say property is a value that describe the object, like color, shape etc.  A method is something you can do with the object. In other words, method is a function which can be performed on the object. For example: 1. Pen is used for writing. 2. Chair is used for sitting.
  • 118. Active Server Pages consist of six built in objects. They are ready made objects which provide functionality to your web pages without requiring you to make custom objects Following are the six built in ASP objects : 1. Application 2. ASP Error 3. Request 4. Response 5. Server 6. Session
  • 119. A group of ASP files that work together to perform some purpose is called an application.
  • 120. ASession object stores information about, or change settings for a user session. Only store SMALL amounts of data in session variables!
  • 121. The Response object is used to send the output back to the client (browser). It includes all the HTTP variables, cookies that will be stored on the client browser and other info about the content being sent
  • 122. The Request object makes available all the values that client browser passes to the server during an HTTP request. It includes client browser info, cookie details ( of this domain only ), client certificates ( if accessing through SSL ) etc.
  • 123. The ASPError object, implemented in ASP 3.0, contains detailed information about the last error that has occurred.
  • 124.
  • 125.  An application on the Web may consists of several ASP files that work together to perform some purpose. The Application object is used to tie these files together.  The Application object is used to store and access variables from any page, just like the Session object. The difference is that ALL users share ONE Application object (with Sessions there is ONE Session object for EACH user).
  • 126. The Application object holds information that will be used by many pages in the application (like database connection information). The information can be accessed from any page. The information can also be changed in one place, and the changes will automatically be reflected on all pages.
  • 127. Store and Retrieve Application Variables Application variables can be accessed and changed by any page in an application. You can create Application variables in "Global.asa"
  • 128. Store and Retrieve Application Variables Application variables can be accessed and changed by any page in the application. You can create Application variables in "Global.asa" <script language="vbscript" runat="server"> Sub Application_OnStart application(“cname")=“ infosys delhi " End Sub </script>
  • 129. The Global.asa file is an optional file that can contain declarations of objects, variables, and methods that can be accessed by every page in an ASP application. All valid browser scripts (JavaScript, VBScript, PerlScript, etc.) can be used within Global.asa.
  • 130. The Global.asa file can contain only the following: Application events Session events <object> declarations Type Library declarations the #include directive Note: The Global.asa file must be stored in the root directory of the ASP application, and each application can only have one Global.asa file.
  • 131. In Global.asa you can tell the application and session objects what to do when the application/session starts and what to do when the application/session ends. The code for this is placed in event handlers. The Global.asa file can contain four types of events:
  • 132. Application_OnStart - Occurs when the FIRST user calls the first page in an ASP application. This event occurs after the Web server is restarted or after the Global.asa file is edited. The "Session_OnStart" event occurs immediately after this event. Session_OnStart - This event occurs EVERY time a NEW user requests his or her first page in the ASP application.
  • 133. Session_OnEnd - This event occurs EVERY time a user ends a session. A user-session ends after a page has not been requested by the user for a specified time (by default this is 20 minutes). Application_OnEnd - This event occurs after the LAST user has ended the session. Typically, this event occurs when a Web server stops. This procedure is used to clean up settings after the Application stops, like delete records or write information to text files.
  • 134. <script language="vbscript" runat="server"> sub Application_OnStart 'some code end sub sub Application_OnEnd 'some code end sub sub Session_OnStart 'some code end sub
  • 135. sub Session_OnEnd 'some code end sub </script> Because we cannot use the ASP script delimiters (<% and %>) to insert scripts in the Global.asa file, we put subroutines inside an HTML <script> element.
  • 136. In this example we will create a Global.asa file that counts the number of current visitors. The Application_OnStart sets the Application variable "visitors" to 0 when the server starts The Session_OnStart subroutine adds one to the variable "visitors" every time a new visitor arrives
  • 137. The Session_OnEnd subroutine subtracts one from "visitors" each time this subroutine is triggered The Global.asa file: <script language="vbscript" runat="server"> Sub Application_OnStart Application("visitors")=0 End Sub
  • 138. Sub Session_OnStart Application.Lock Application("visitors")=Application("visit ors")+1 Application.UnLock End Sub Sub Session_OnEnd Application.Lock Application("visitors")=Application("visit ors")-1 Application.UnLock End Sub </script>
  • 139. To display the number of current visitors in an ASP file: <html> <head> </head> <body> <p>There are < %response.write(Application("visit ors"))%> online now!</p> </body> </html>
  • 140. The Global.asa file is contain declarations of objects, variables, and methods that can be accessed by every page in an ASP application. All valid browser scripts (JavaScript, VBScript, PerlScript, etc.) can be used within Global.asa.
  • 141. The ASP Server object is used to access properties and methods on the server. Its properties and methods are described below: Properties Script Timeout Sets or returns the maximum number of seconds a script can run before it is terminated Methods Create Object Creates an instance of an object Execute Executes an ASP file from inside another ASP file
  • 142. GetLastError() Returns an ASP Error object that describes the error condition that occurred HTMLEncode Applies HTML encoding to a specified string <% = Server.HTMLEncode("The paragraph tag: <P>") %>
  • 143. MapPath Maps a specified path to a physical path <% =Server.MapPath(Request.ServerVariables("PATH_INFO")) %> Transfer Sends (transfers) all the information created in one ASP file to a second ASP file URLEncode Applies URL encoding rules to a specified string
  • 144. ASession object stores information about, or change settings for a user session. Only store SMALL amounts of data in session variables!
  • 145. When you are working with an application on your computer, you open it, do some changes and then you close it. This is much like a Session. The computer knows who you are. It knows when you open the application and when you close it.  Variables stored in a Session object hold information about one single user, and are available to all pages in one application.
  • 146.  Common information stored in session variables are name, id, and preferences. The server creates a new Session object for each new user, and destroys the Session object when the session expires.
  • 147. A session starts when: A new user requests an ASP file, and the Global.asa file includes a Session_OnStart procedure A value is stored in a Session variable A user requests an ASP file, and the Global.asa file uses the <object> tag to instantiate an object with session scope
  • 148. The most important thing about the Session object is that you can store variables in it. The example ahead will set the Session variable username to “Shawn" and the Session variable age to “30":
  • 150. When the value is stored in a session variable it can be reached from ANY page in the ASP application: Welcome <% Response.Write(Session("username") ) %> The line above returns: "Welcome Shawn".
  • 151. The Contents collection contains all session variables. The example ahead removes the session variable "sale" if the value of the session variable "age" is lower than 18:
  • 152. <% If Session.Contents("age")<18 then Session.Contents.Remove("sale") End If %> To remove all variables in a session, use the RemoveAll method: <% Session.Contents.RemoveAll() %>
  • 153. Properties SessionID The SessionID is a read-only property that uniquely identifies each current user's session. Each session has a unique identifier that is generated by the server when the session is created and stored as a cookie on the client machine. TimeOut The Timeout property sets or returns the timeout period (in minutes) for thе Session object in this application. If the user does not refresh or request a page within the timeout period,the session ends. Can be changed in individual pages as required.
  • 154. Acookie is often used to identify a user.
  • 155. Acookie is often used to identify a user. A cookie is a small file that the server embeds on the user's computer. Each time the same computer requests a page with a browser, it will send the cookie too. With ASP, you can both create and retrieve cookie values.
  • 156. The "Response.Cookies" command is used to create cookies. The Response.Cookies command must appear BEFORE the <html> tag.
  • 157. IN THE EXAMPLE BELOW, WE WILL CREATE A COOKIE NAMED "FIRSTNAME" AND ASSIGN THE VALUE "ALEX" TO IT: <% Response.Cookies("firstname")="Alex" %>
  • 158. IT IS ALSO POSSIBLE TO ASSIGN PROPERTIES TO A COOKIE, LIKE SETTING A DATE WHEN THE COOKIE SHOULD EXPIRE: <% Response.Cookies("firstname")="Alex Response.Cookies("firstname").Expires =#May 10,2012# %>
  • 159. The"Request.Cookies" command is used to retrieve a cookie value
  • 160. IN THE EXAMPLE BELOW, WE RETRIEVE THE VALUE OF THE COOKIE NAMED “FIRSTNAME" AND DISPLAY IT ON A PAGE: <% fname=Request.Cookies("firstname") response.write("Firstname=" & fname) %>
  • 162. Form  Forms are a convenient way to communicate with visitors to your Web site.  A form on a page allows a user to enter data that is sent to a server for processing
  • 163.  The <form> tag is used to create an HTML form for user input.  A form can contain input elements like text fields, checkboxes, radio-buttons, submit buttons and more. A form can also contain dropdown list, textarea elements.  Forms are used to pass data to a server.
  • 164. Attributes oF Form  Action = Specifies where to send the form-data when a form is submitted  Value =“url”  Method = Specifies how to send form-data  Value = “get or post”  Name = Specifies the name for a form
  • 165. Controls  Users interact with forms through named controls.  Each control has both an initial value and a current value, both of which are character strings.
  • 166. Control types  The Input Element  The most important form element is the input element.  The input element is used to select user information.  An input element can vary in many ways, depending on the type attribute. An input element can be of type text field, checkbox, password, radio button, submit button, and more.
  • 168.  Text Fields  <input type="text">  defines a one-line input field that a user can enter text into it.  E.G.  <form> First name: <input type="text" name="firstname"> Last name: <input type="text" name="lastname"> </form>
  • 169. Password Field  <input type="password">  defines a password field:  E.G.  <form> Password: <input type="password" name="pwd" /> </form>
  • 170.  Radio Buttons  <input type="radio">  defines a radio button. Radio buttons let a user select ONLY ONE one of a limited number of choices:  E.G  <form> <input type="radio" name="sex" value="male"> Male <input type="radio" name="sex" value="female"> Female </form>
  • 171.  Checkboxes  <input type="checkbox">  defines a checkbox. Checkboxes let a user select ONE or MORE options of a limited number of choices.  E.G.  <form> <input type="checkbox" name="v1" value="Bike" /> I have a bike<br /> <input type="checkbox" name="v2" value="Car" /> I have a car </form>
  • 172. Submit Button  <input type="submit">  defines a submit button.  A submit button is used to send form data to a server. The data is sent to the page specified in the form's action attribute. The file defined in the action attribute usually does something with the received input:  <form name="input" action=“a.asp" method="get"> Username: <input type="text" name="user" /> <input type="submit" value="Submit" /> </form>
  • 173. Pull down Lists: It is used to select one choice out of many choices. This control is very useful when we have number of choices and we have to choose only one particular choice. These lists occupy minimum amount of space. We use the <select> tag for this.  Syntax  <select name=”unique_name” size=”n”>  <option value=”any_value”>  <option value=”any_value ”>  </select>
  • 174. <html> <head><title>Asking for information</title></head> <body> <form method="post" action="form_response.asp"> Your name: <input type="text" name="name" size="20"><BR> Your email: <input type="password" name="email" size="15"><BR> <input type="Submit" value="Submit"> </form> </body> </html>
  • 175.  <html> <head><title>Responding to a form</title></head> <body> Your name is <% =Request.Form("name") %> <BR> Your email is <% =Request.Form("email") %> </body> </html>
  • 176.
  • 177. The Response object is used to send the output back to the client (browser). It includes all the HTTP variables, cookies that will be stored on the client browser and other info about the content being sent.
  • 178. Redirect Redirects the browser to another page (URLe.g.Response.Redirect "http://www.gurchet.orgfree.com". Write Writes the specified string to the web page e.g. Response.Write "Hello World!".
  • 179. The Request object makes available all the values that client browser passes to the server during an HTTP request. It includes client browser info, cookie details ( of this domain only ), client certificates ( if accessing through SSL ) etc.
  • 180. Form Collection of all the values of Form element in the HTTP request. QueryString Collection of variables which are stored in the HTTP query string. Name / value pairs can also be appended to the URL after the end of page name e.g. "http://www.stardeveloper.com/asp_request.asp? author=Faisal+Khan" contains one variable 'author' with a value of 'Faisal Khan'.
  • 181. Caching is a well known concept in computer science: when programs continually access the same set of instructions, a massive performance benefit can be realized by storing those instructions in RAM. This prevents the program from having to access the disk thousands or even millions of times during execution by quickly retrieving them from RAM. Caching on the web is similar in that it avoids a roundtrip to the origin web server each time a resource is requested and instead retrieves the file from a local computer's browser cache or a proxy cache closer to the user.
  • 182. The Buffer property specifies whether to buffer the output or not. When the output is buffered, the server will hold back the response to the browser until all of the server scripts have been processed, or until the script calls the Flush or End method. Note: If this property is set, it should be before the <html> tag in the .asp file response.Buffer[=flag]
  • 184.
  • 185. For Communicating With User We Use Forms In Form We Have Two Method For Communicating User 1. Method Post 2. Method Get Form tag provide various form fields for sending information to server. And we use these fields to communicating. Like text field to send mails
  • 186. Another <form> tag attribute specifies how the information will be sent to wherever it's going. That's the "method" attribute. The method attribute is either method="POST" or method="GET" Which you use depends on how the destination program or function wants to receive the information.
  • 187. Sending With Method GET method="GET" is used if you want to send information somewhere via a browser URL. You've seen URLs that send information; they look something like: http://gurchet.orgfree.com/handler.name? color=red&shape=round In the above URL, the part after the question mark is information sent to handler.name. Multiple information chunks are separated with an ampersand. The GET method can send only a limited amount of information. The limitation depends on the server where the current web page is on and the server where the information is sent to. The limitation can be as little as 256 bytes but is often 1k or more.
  • 188. Sending With Method POST method="POST" is the most common method used to send information from a form to an information processing program or function. This is the method used when sending form information to JavaScript functions. Most CGI programs are written to accept information with the POST method, some to accept only the POST method. The POST method can send much more information than the typical GET method. Currently, most browsers and servers limit the amount of POST information to about 32k. With POST, the information is not sent via the URL. The sending is invisible to the site visitor.
  • 189.
  • 190. Accessing the HTTP Headers Standard HTTP Headers Environment Variables Using Cookies Advantages & disadvantages cookies
  • 191. When the client request a web page from the server it not only sends the url of web page requested but also send some additional information this extra information consists of useful facts about the client 1. What browser is being used 2. What operating system the client running 3. What url the user just come from These information are called request header
  • 192. Request Header is a single line of text that your browser sends to the web Server when requesting to view any web page. Response Header when the server sends back the requested web page to the client it also sends a set of headers known as response headers. Both request headers and response headers are called HTTP Header
  • 193. An HTTP Header is a single piece of information sent either from client To the server when requesting a page or from the server to the client when Responding to a page request. 1. HTTP_ACCEPT 2. HTTP_ACCEPT_LANGAGUE 3. HTTP_CONNECTION 4. HTTP_HOST 5. HTTP_USER_AGENT 6. HTTP_REFERER 7. HTTP_COOKIE
  • 194. The HTTP Headers are useful for obtaining information about current Visitor but tell you nothing about the web server or asp page that is being requested by the client. To obtain such information we use web server’s Environment Variables Environment Variables are bit of information that web browser make available to any Program that requested them. It contain information such as:- 1. Name of web server 2. url currently processing asp page 3. Name of software being used by web server.
  • 195. 1. URL 2. PATH_INFO 3. PATH_TRANSLATED 4. APPL_PHYSICAL_PATH 5. QUERY_STRING 6. SERVER_NAME 7. SERVER_SOFTWARE Many environment variables do not contain a value because it use when required for example CERT Variable contains empty strings as their value. This is because these variable are Used only when client and server use CERTIFICATES .When a browser and web Server communicate over a secure channel, certificates are used to ensure the identity of the Client to the server.
  • 196. Cookies are small amount of information stored in client computer for some time. When cookies are created on the client computer the developer need to specify when they expire. After a cookie expire it will automatically remove itself from the client computer. Cookies created response.cookies(“user”)=“John” Cookies read request.cookies(“user”) Cookies expire response.cookies(“user”).expires=date+10
  • 197. 1. Cookies stores on client computer so not need more space in web server 2. Save small amounts of information for very long periods of time 3. It is used to customize a user visit to your web site 1. User can choose not to accept cookies on their web browser 2. It not save large amount to date 3. It save only string, date or numeric date 4. It is not secure because if temp folder deleted it also delete all cookies
  • 198.
  • 199. 1. Web is stateless ? 2. Why to maintain state ? 3. Session Object 4. Asp application object 5. Asp global.asa file 6. Events in global.asa
  • 200. An application is said to have state if it persists information for each user. In a web site this is not the case for example if you fill out s form on A web page and then revisit the form at some time later the form fields will not contain The valued you entered earlier because web site lack state this is called stateless
  • 201. For maintaining state asp provides many ways these ways are used to kept information Which is used in round tripping process. In asp we have build in objects and collection for maintaining state Session object and application objects are used for this purpose, cookies are also used to Maintain state
  • 202. PITFALLS OF SESSION VARIABLES (DRAWBACKS) If user select that his system not save session then session not work Default time is 20 minute it is also big disadvantages
  • 203.
  • 204. The ASPError object, implemented in ASP 3.0, contains detailed information about the last error that has occurred. This information can only be accessed through the Server.GetLastError. The ASPError object has nine read-only properties and no methods. Properties •ASP Code This property returns the error code generated by IIS. •Description The description property returns the short description of the error. •ASP Description Returns a string that contains more detailed error information than the Description property, but it is not available for all errors.
  • 205. There are 3 main types of errors: Compile-time errors These errors are usually in the syntax of the code and stop the ASP from compiling. You may have experienced this if you left the closing ”Next” statement off of a “For” loop.
  • 206. Runtime errors These happen when you try to execute the ASP page. For example, if you try setting a variable outside its allowed range. Logic errors Logic errors are harder to detect. The problem lies within the structure of the code, and the computer cannot detect an error. These types require thorough testing before rolling out the application.
  • 207. 5- invalid procedure call 6- overflow 7- out of memory 11- division by zero 13- type mismatch 53- internal error 61- disk full 76- path not found 438- object not support method or property 424- object required
  • 208. <% On Error Resume Next X = 15 Y=5 Z = 15 Response.Writes( X/Y & "<b><br>") Response.Write( X/Z & "<b><br>") If Err.Number = 0 Then response.write("no error") else Response.Write(err.number & "<br>") Response.Write(err.description) End If %>
  • 209. Non Asp Error Error Created By Server Is Called Non Asp Error In This type Of Error Program Is Not Executated Because Server Creates Problem. Some Time Message Come – Server Not Exist Or File Not Found
  • 210.
  • 211. database: A collection of related information stored in a structured format. Database is often used interchangeably with the term table A table is a single store of related information; a database can consist of one or more tables of information that are related in some way.
  • 212. data entry: The process of getting information into a database, usually done by people typing it in by way of data-entry forms designed to simplify the process.
  • 213. dbms: Database management system. A program which lets you manage information in databases. Lotus Approach, Microsoft Access and FileMaker Pro, for example, are all DBMSs, although the term is often shortened to 'database'. So, the same term is used to apply to the program you use to organise your data and the actual data structure you create with that program.
  • 214.
  • 215. field: Fields describe a single aspect of each member of a table. A student record, for instance, might contain a last name field, a first name field, a date of birth field and so on. All records have exactly the same structure, so they contain the same fields. The values in each field vary from record to record, of course. In some database systems, you'll find fields referred to as attributes.
  • 216. flat file: A database that consists of a single table. Lightweight database programs such as the database component in Microsoft Works are sometimes called 'flat-file managers‘ (or list managers) because they can only handle single-table databases. More powerful programs, such as FileMaker Pro, Access, Approach and Paradox, can handle multi-table databases, and are called relational database managers, or RDBMSs.
  • 217. primary key: A field that uniquely identifies a record in a table. In a students table, for instance, a key built from last name + first name might not give you a unique identifier (two or more Jane Does in the school, for example). To uniquely identify each student, you might add a special Student ID field to be used as the primary key.
  • 218. foreign key: A key used in one table to represent the value of a primary key in a related table. While primary keys must contain unique values, foreign keys may have duplicates. For instance, if we use student ID as the primary key in a Students table (each student has a unique ID), we could use student ID as a foreign key in a Courses table: as each student may do more than one course,
  • 219. index: A summary table which lets you quickly look up the contents of any record in a table. Think of how you use an index to a book: as a quick jumping off point to finding full information about a subject. A database index works in a similar way. You can create an index on any field in a table
  • 220. SQL: Structured Query Language (pronounced sequel in the US; ess-queue-ell elsewhere). A computer language designed to organize and simplify the process of getting information out of a database in a usable form, and also used to reorganize data within databases. SQL is most often used on larger databases on minicomputers, mainframes and corporate servers.
  • 221. query: A view of your data showing information from one or more tables. For instance, using the sample database we used when describing normalisation, you could query the Students database asking "Show me the first and last names of the students Whose roll no is 90821.
  • 222. RDBMS: Relational database management system. A program which lets you manage structured information stored in tables and which can handle databases consisting of multiple tables.
  • 223. RECORD: A record contains all the information about a single 'member' of a table. In a students table, each student's details (name, date of birth, contact details, and so on) will be contained in its own record.
  • 224. RELATIONAL DATABASE: A database consisting of more than one table. In a multi-table database, you not only need to define the structure of each table, you also need to define the relationships between each table in order to link those tables correctly.
  • 225. REPORT: A form designed to print information from a database (either on the screen, to a file or directly to the printer).
  • 226. TABLE: A single store of related information. A table consists of records, and each record is made up of a number of fields. Just to totally confuse things, tables are sometimes called relations. You can think of the phone book as a table: It contains a record for each telephone subscriber, and each subscriber's details are contained in three fields - name, address and telephone.
  • 227. Dr. E.F. Codd, an IBM researcher, first developed the relational data model in 1970. In 1985, Dr. Codd published a list of 12 rules that concisely define an ideal relational database, which have provided a guideline for the design of all relational database systems ever since.
  • 228. Rule 1: The Information Rule All data should be presented to the user in table form Rule 2: Guaranteed Access Rule All data should be accessible without Ambiguity (doubt). This can be accomplished through a combination of the table name, primary key, and column name.
  • 229. Rule 3: Systematic Treatment of Null Values A field should be allowed to remain empty. This involves the support of a null value, which is distinct from an empty string or a number with a value of zero. Of course, this can't apply to primary keys. In addition, most database implementations support the concept of a nun- null field constraint that prevents null values in a specific table column.
  • 230. Rule 4: Dynamic On-Line Catalog Based on the Relational Model A relational database must provide access to its structure through the same tools that are used to access the data. This is usually accomplished by storing the structure definition within special system tables.
  • 231. Rule 5: Comprehensive Data Sublanguage Rule The database must support at least one clearly defined language that includes functionality for data definition, data manipulation, data integrity, and database transaction control. All commercial relational databases use forms of the standard SQL (Structured Query Language) as their supported comprehensive language.
  • 232. Rule 6: View Updating Rule Data can be presented to the user in different logical combinations, called views. Each view should support the same full range of data manipulation that direct-access to a table has available. In practice, providing update and delete access to logical views is difficult and is not fully supported by any current database.
  • 233. Rule 7: High-level Insert, Update, and Delete Data can be retrieved from a relational database in sets constructed of data from multiple rows and/or multiple tables. This rule states that insert, update, and delete operations should be supported for any retrievable set rather than just for a single row in a single table
  • 234. Rule 8: Physical Data Independence The user is isolated from the physical method of storing and retrieving information from the database. Changes can be made to the underlying architecture ( hardware, disk storage methods ) without affecting how the user accesses it.
  • 235. Rule 9: Logical Data Independence How a user views data should not change when the logical structure (tables structure) of the database changes. This rule is particularly difficult to satisfy. Most databases rely on strong ties between the user view of the data and the actual structure of the underlying tables.
  • 236. Rule 10: Integrity Independence The database language (like SQL) should support constraints on user input that maintain database integrity. This rule is not fully implemented by most major vendors. At a minimum, all databases do preserve two constraints through SQL. No component of a primary key can have a null value. (see rule 3) If a foreign key is defined in one table, any value in it must exist as a primary key in another table.
  • 237. Rule 11: Distribution Independence A user should be totally unaware of whether or not the database is distributed (whether parts of the database exist in multiple locations). A variety of reasons make this rule difficult to implement;
  • 238. Rule 12: Nonsubversion Rule There should be no way to modify the database structure other than through the multiple row database language (like SQL). Most databases today support administrative tools that allow some direct manipulation of the datastructure.
  • 239.
  • 240. 1.What is ADO? ADO is a Microsoft technology ADO stands for ActiveX Data Objects ADO is a Microsoft Active-X component ADO is automatically installed with Microsoft IIS ADO is a programming interface to access data in a database
  • 241. 2.Accessing a Database from an ASP Page The common way to access a database from inside an ASP page is to: Create an ADO connection to a database Open the database connection Create an ADO recordset Open the recordset Extract the data you need from the recordset Close the recordset Close the connection
  • 242. 3. How DSN-less Database Connection Created ? The easiest way to connect to a database is to use a DSN-less connection. A DSN-less connection can be used against any Microsoft Access database on your web site. If you have a database called "northwind.mdb" located in a web directory like "c:/webdata/", you can connect to the database with the following ASP code: <% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0“ conn.Open "c:/webdata/northwind.mdb" %>
  • 243. 4. What is Connection Object ? The ADO Connection Object is used to create an open connection to a data source. Through this connection,you can access and manipulate a database.If you want to access a database multiple times,you should establish a connection using the Connection object. You can also make a connection to a database by passing a connection string via a Command or Recordset object. However,this type of connection is only good for one specific, single query. set objConnection=Server.CreateObject("ADODB.connection")
  • 244. 5. What is Recordset Object ? The ADO Recordset object is used to hold a set of records from a database table. A Recordset object consist of records and columns (fields). In ADO, this object is the most important and the one used most often to manipulate data from a database. set objRecordset=Server.CreateObject("ADODB.recordset")
  • 245. 7. How Data is Extracted from Record set After a record set is opened, we can extract data from record set. Suppose we have a database named "North wind", we can get access to the "Customers" table inside the database <% dim con set con=Server.createObject("ADODB.connection") con.open "provider=microsoft.jet.oledb.4.0;Data source="& server. mappath("db1.mdb") set rs=Server.createObject("ADODB.Recordset") q="select * from stu" rs.open q,con response.write("<table border=3 align=center height=30% width=20% > "&"<tr><th>") response.write("ID" & "</td><td>" & "<b> Name"& "</td><td>" & "<b> Marks")
  • 246. response.write("</td></tr>") response.write("<br>") do while not rs.EOF response.write("<tr><td>") response.write(rs("id")&" " & "</td><td>") response.write(rs("name")&" " & "</td><td>") response.write(rs("marks")&" " & "</td>") response.write("<br>") response.write("</tr>") rs.movenext loop %>
  • 247.  Recordset Object  The ADO Recordset object is used to hold a set of records from a database table. A Recordset object consist of records and columns (fields).  In ADO, this object is the most important and the one used most often to manipulate data from a database.
  • 248. What is Recordset updating: Immediate updating - all changes are written immediately to the database once you call the Update method. Batch updating - the provider will cache multiple changes and then send them to the database with the Update Batch method.
  • 249. 12. Define 4 different types of cursor in ADO Cursor: Database cursor is a control structure that enables traversal over the records in a database. Cursors are used by database programmers to process individual rows returned by database system queries. Types Of Cursor Dynamic cursor – Allows you to see additions, changes, and deletions by other users. Keyset cursor – Like a dynamic cursor, except that you cannot see additions by other users, and it prevents access to records that other users have deleted.
  • 250. Static cursor Provides a static copy of a recordset for you to use to find data or generate reports. Static cursors Support scrolling backward and forward, but they do not support updates.This is the only type of cursor allowed when you open a client-side Recordset object. The following is an example of how to obtain a static cursor by using ADO.NET: cmd.CommandText = "Select * from tablename"; SqlCeResultSet rs = cmd.ExecuteResultSet (ResultSetOptions.Scrollable | ResultSetOptions. Insensitive);
  • 251. Forward-only cursor -Allows you to only scroll forward through the Recordset. -Additions, changes, or deletions by other users will not be visible. Popular Relational Database Product SQL 7 ORACLE8 SYSBASE IBM’S DB2 INFORMIX