20
An Overview of Database An Overview of Database Access on the Web Access on the Web Using ASP and Microsoft Database Using ASP and Microsoft Database Technology Technology Sheffield Hallam University 2003 Sheffield Hallam University 2003

An Overview of Database Access on the Web An Overview of Database Access on the Web Using ASP and Microsoft Database Technology Sheffield Hallam University

  • View
    217

  • Download
    1

Embed Size (px)

Citation preview

An Overview of Database Access on An Overview of Database Access on the Webthe Web

Using ASP and Microsoft Database TechnologyUsing ASP and Microsoft Database Technology

Sheffield Hallam University 2003Sheffield Hallam University 2003

Structure of SessionStructure of Session

Lecture:Lecture: An Overview of Database Access Over the WebAn Overview of Database Access Over the Web (30 mins)(30 mins)

Reading exerciseReading exercise 1 (20 mins): 1 (20 mins):A. Introduction to Client Server technology on the webA. Introduction to Client Server technology on the webB. Introduction to HTML, Scripting Languages ASP B. Introduction to HTML, Scripting Languages ASP

technologytechnologyC. An introduction to ASPC. An introduction to ASPD. Getting acquainted with Microsoft Access databasesD. Getting acquainted with Microsoft Access databases

Activity 1Activity 1: Experimenting with HTML (20 mins): Experimenting with HTML (20 mins) Activity 2Activity 2: Experimenting with ASP (25 mins): Experimenting with ASP (25 mins) Activity 3Activity 3: Playing with the Shopping Cart e-commerce : Playing with the Shopping Cart e-commerce

Site (15 mins)Site (15 mins)

Structure of PresentationStructure of Presentation

Introduce ASP and Microsoft Database Introduce ASP and Microsoft Database technologiestechnologies

3 Tiered Network architecture 3 Tiered Network architecture Example scenarioExample scenario Simulate working example of ASPSimulate working example of ASP Demonstrate Shopping Cart e-Commerce SiteDemonstrate Shopping Cart e-Commerce Site Summarise PresentationSummarise Presentation Discuss areas for further studyDiscuss areas for further study

What is Microsoft Access?What is Microsoft Access?

Microsoft’s economical, Small-Scale RDBMSMicrosoft’s economical, Small-Scale RDBMS Currently release is Access 2002 (XP)Currently release is Access 2002 (XP) Little brother to Microsoft SQL ServerLittle brother to Microsoft SQL Server Front-end GUI building functions Front-end GUI building functions Moderate performance, 100 max simultaneous Moderate performance, 100 max simultaneous

users, good enough for smaller e-commerce projects users, good enough for smaller e-commerce projects Intuitive GUI, VBA programming, can build self-Intuitive GUI, VBA programming, can build self-

contained database applicationscontained database applications

Access 2002 – Integrated Development Access 2002 – Integrated Development EnvironmentEnvironment

SQL ServerSQL Server

SQL Server is very popularSQL Server is very popular Similar functionality to AccessSimilar functionality to Access Many more advanced features e.g. stored Many more advanced features e.g. stored

procedures, triggersprocedures, triggers SQL suitable for larger scale e-commerce SQL suitable for larger scale e-commerce

i.e 1000’s simultaneous usersi.e 1000’s simultaneous users Well worth being familiar with it!Well worth being familiar with it!

SQL Server 2000 - IDESQL Server 2000 - IDE

What is ASP?What is ASP? ASP stands for ASP stands for Active Server PagesActive Server Pages Developed by MicrosoftDeveloped by Microsoft Normally coded using VBScriptNormally coded using VBScript Language used to ‘script’ operations on the Language used to ‘script’ operations on the

server – invisible to client machineserver – invisible to client machine Highly popular, used by 1000’s Web sites e.g. Highly popular, used by 1000’s Web sites e.g.

Halifax.co.ukHalifax.co.uk Enhances Web pages by adding dynamic contentEnhances Web pages by adding dynamic content

What can ASP do (that HTML can’t)?What can ASP do (that HTML can’t)?

Interact with databases to read and write data Interact with databases to read and write data Read and write ‘cookies’ to a users computerRead and write ‘cookies’ to a users computer Track user activity within a Web siteTrack user activity within a Web site Check user input (validation)Check user input (validation) Talk to other applications on server e.g. WordTalk to other applications on server e.g. Word Talk to custom built applications on server Talk to custom built applications on server Send bulk email or automated email responsesSend bulk email or automated email responses Return dynamic HTML code back to the client Return dynamic HTML code back to the client Read data from the end of a URL (called a query Read data from the end of a URL (called a query

string)string)

What is ASP used for on Web?What is ASP used for on Web?

Search enginesSearch engines Online bankingOnline banking E-commerceE-commerce Web mailWeb mail Financial calculatorsFinancial calculators Online mortgage, credit, loan applications Online mortgage, credit, loan applications

etcetc

Sample of ASP codeSample of ASP code

<%

dim req, copyright

copyright =" This sample program Copyright SHU, 2003"

req=request.QueryString("action")

if req = "search" then

response.write(“Searching Database”)

call searchResponse()

end if

%>

Scenario – Phase Test MarksScenario – Phase Test Marks

Students take phase tests on a regular basisStudents take phase tests on a regular basis The tutor logs the marks for these tests on a The tutor logs the marks for these tests on a

table called table called tblmarks,tblmarks, on an Database called on an Database called phasephase

The course leader uses an ASP page to request The course leader uses an ASP page to request the mark of any student and a pass/ fail statusthe mark of any student and a pass/ fail status

Scenario – Phase Test MarksScenario – Phase Test Marks

Test Marks

Student completes Phase Test

Test MarksTutor records

marks

Student Data

Course Leader requests mark

Database

phase database Request

ArchitectureArchitecture Model of Client-Server Architecture Model of Client-Server Architecture

Web Server (e.g. Microsoft IIS) Client (e.g. Windows 2000)

The Internet

Data Out

Data in

ASP Pages

ASP pages

Keyed Data

Data Req.Data

Request

Database

ASP 1 - Phase TestsASP 1 - Phase Tests

ASP Code WalkthroughASP Code Walkthrough ASP code is contained within ASP code is contained within <%<% tags tags VBscript syntax almost identical to VBVBscript syntax almost identical to VB ASP code reads ASP code reads querystringquerystring from URL to from URL to

determine actionsdetermine actions ASP dynamically returns HTML via ASP dynamically returns HTML via response.write response.write

ASP seamlessly connects to SQL databaseASP seamlessly connects to SQL database Uses server-side validation to check form dataUses server-side validation to check form data Uses inline script e.g. Uses inline script e.g. <%=copyright%><%=copyright%> to insert to insert

data directly into HTML codedata directly into HTML code

ASP 2 – Small E-commerce SiteASP 2 – Small E-commerce Site

ASP 3 – Pushing the limits of ASPASP 3 – Pushing the limits of ASP

Summary of LectureSummary of Lecture

Introduced ASP, HTML and Access Introduced ASP, HTML and Access technologytechnology

Reviewed client-server architecture Reviewed client-server architecture Simulated how ASP can be used to retrieve Simulated how ASP can be used to retrieve

data from an SQL Server databasedata from an SQL Server database Explained ASP code in detailExplained ASP code in detail

Areas For Further StudyAreas For Further Study

What are the pros and cons of using ASP?- What are the pros and cons of using ASP?- How do alternatives compare e.g. JSPHow do alternatives compare e.g. JSP

How does the performance of ASP compare How does the performance of ASP compare to VB – why is there a difference?to VB – why is there a difference?

How much of an improvement is ASP.net?How much of an improvement is ASP.net? How much better is SQL Server 2000 than How much better is SQL Server 2000 than

Access?Access? In which business situations would you In which business situations would you

choose SQL Server over Access?choose SQL Server over Access?