Marrying HTML and Databases using Active Server Pages JJ Cadiz.

Slides:



Advertisements
Similar presentations
Languages for Dynamic Web Documents
Advertisements

IIS Technologies.
DT211/3 Internet Application Development Active Server Pages & IIS Web server.
Server-Side vs. Client-Side Scripting Languages
1 Chapter 12 Working With Access 2000 on the Internet.
1 Today: Introduction to ASP- Part 1 Explain the client/server architecture Explain Web-based client/server applications Understand the essentials of Active.
Session 6 Server-side programming - ASP. An ASP page is an HTML page interspersed with server-side code. The.ASP extension instead of.HTM denotes server-side.
Mark Dixon, SoCCE SOFT 131Page 1 20 – Web applications: HTML and Client-side code.
15 Chapter 15 Web Database Development Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
ACTIVE X By Ethan Huang. OUTLINE What is ActiveX? Component of ActiveX Why ActiveX? ActiveX and Java Security Issue.
B.Sc. Multimedia ComputingMedia Technologies Database Technologies.
INTERNET DATABASE Chapter 9. u Basics of Internet, Web, HTTP, HTML, URLs. u Advantages and disadvantages of Web as a database platform. u Approaches for.
Part 1: Overview of Web Systems Part 2: Peer-to-Peer Systems Internet Computing Workshop Tom Chothia.
Week 2 IBS 685. Static Page Architecture The user requests the page by typing a URL in a browser The Browser requests the page from the Web Server The.
INTERNET DATABASE. Internet and E-commerce Internet – a worldwide collection of interconnected computer network Internet – a worldwide collection of interconnected.
Introduction to Active Server Pages
4/8/99 C. Edward Chow Page 1 Active Server Page It is a server-side scripting environment for creating dynamic content. ASP are files with.asp extension,
1 Computing for Todays Lecture 22 Yumei Huo Fall 2006.
14 1 Chapter 14 Database Connectivity and Web Development Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
2/22/00J. Alberto Espinosa -- CMU/GSIA MIS Dynamic HTML Using Active Server Pages (ASP) Alberto Espinosa MIS
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Beginning Active Server Pages Barry Sosinsky Valda Hilley Programming.
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Web Design Scripting and the Web. Books on Scripting.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
1998 PI System Users’ Conference PI on the Web: A Primer for PI Users Omicron Consulting 1998 PI System Users’ Conference.
Data-Enabled Web Sites: Classibooks.com & Internet Database Technologies Colin Fukai April 4, 2000 Gonzaga University.
3/8/00asp00 1 Active Server Pages from Microsoft Nancy McCracken Northeast Parallel Architectures Center at Syracuse.
Student Learning Environment on the World Wide Web l CGI-programming in Perl for the connection of databases over the Internet. l Web authoring using Frontpage.
Simple Database.
Elements of ASP Documents Adapted from MCDN Web Workshop ( and Webmonkey’s Introduction to Active.
Fundamentals of Database Chapter 7 Database Technologies.
Tutorial 10 by Sam ine1020 Introduction to Internet Engineering 1 Database & Server-side Scripting Tutorial 10.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 30 – Bookstore Application: Client Tier Examining.
Universiti Utara Malaysia Chapter 3 Introduction to ASP.NET 3.5.
SQL Queries Relational database and SQL MySQL LAMP SQL queries A MySQL Tutorial and applications Database Building.
Putting it all together Dynamic Data Base Access Norman White Stern School of Business.
How to Connect to Database ODBC (Open Database Connectivity) ADO (ActiveX Data Object) ASP Code To Connect to Database Recordset Object Navigating through.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 14 Database Connectivity and Web Technologies.
Database Management Systems CS 420. Topics Outline 1. Introduction 2. HTML Review 3. VBScript 4. Access DBMS 5. Relational Database 6. Design Process.
Building High Performance, Robust Server Applications with Internet Information Server 5.0 Van Van IIS - Program Manager Microsoft Corporation.
Web111a_chapt08.ppt HTML: Section 8 JavaScript CGI Programs (Server Side programs) Common Gateway Interface Run on server Communicate with user across.
Microsoft FrontPage 2003 Illustrated Complete Integrating a Database with a Web Site.
Chapter 1 Introduction to Ecommerce What is E-Commerce? Microsoft Technologies for E- Commerce. What is an ASP Page. Objectives :
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
ASP. ASP is a powerful tool for making dynamic and interactive Web pages An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are.
WHAT IS E-COMMERCE? E-COMMERCE is a online service that helps the seller/buyer complete their transaction through a secure server. Throughout the past.
Database Connectivity and Server-Side Scripting Chapter 12.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 14 Database Connectivity and Web Technologies.
8 th Semester, Batch 2009 Department Of Computer Science SSUET.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Web Design Terminology Unit 2 STEM. 1. Accessibility – a web page or site that address the users limitations or disabilities 2. Active server page (ASP)
Generating XML Data from a Database Eugenia Fernandez IUPUI.
XP Creating Web Pages with Microsoft Office
Tonga Institute of Higher Education IT 141: Information Systems
Active Server Pages Computer Science 40S.
Introduction to ASP By “FlyingBono” 2009_01 By FlyingBono 2009_01
Relational database and SQL MySQL LAMP SQL queries
Technology Vocabulary Words
Tonga Institute of Higher Education IT 141: Information Systems
Server-Side Processing II
Tonga Institute of Higher Education IT 141: Information Systems
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
Database Connectivity and Web Development
Presentation transcript:

Marrying HTML and Databases using Active Server Pages JJ Cadiz

Outline Who is this JJ guy? What can you do with ASP? How does ASP work? Hardware & Software requirements Data access using ASP Example ASP systems

Things I won’t cover Security Visual Basic Script Java Script Client-side scripting Scalability »Concurrency »Big web sites don’t use MS Access (I hope)

About my background... Masters of HCI student, class of 99 Work full time on a CMU research team Have used ASP heavily for past two years »data collection »experimental tools development Joining Microsoft Research in August

What can you do with ASP?

Example sites Microsoft tech support site support.microsoft.com On-line stores On-line auction houses

ASP jobs If you can marry databases and HTML, there are companies who want you Search job web sites using keywords “active server pages” »careers.wsj.com »

The Mental Model of ASP

Normal HTML 1. Client requests an html page 2. Server sends client html page

Dynamic HTML with ASP 1. Client requests an.asp file 2. Server processes.asp file, which generates HTML 3. Server sends generated HTML to client

ASP, SQL, Databases, and HTML Web Server Client Browser - Internet Explorer - Netscape Navigator Database(s) HTML ASP VBScript & SQL

Hardware & Software for ASP

Server Requirements You can’t do ASP on Andrew ASP requires an MS Windows environment »NT Server with Internet Information Server »NT Workstation with “Peer Web Services” (10-user connection limit) »Win95/98 with Personal Web Server

Developer Tools Your favorite HTML editor Your favorite script/code editor A database (Access, Oracle, SQLServer) My favorite: MS InterDev

Data Access using ASP

Queries in ASP: The Recordset The mental model of a recordset How to create and use a recordset in ASP Example system: Employee compensation database

Creating Recordsets in ASP ‘ Establish connection to database Set empCompConn = Server.CreateObject("ADODB.Connection") empCompConn.Open ”empComp” ‘empComp must be a DSN ‘ Create the SQL Command and link it to our database Set empCompCmd = Server.CreateObject("ADODB.Command") Set empCompCmd.ActiveConnection = empCompConn empCompCmd.CommandText = "SELECT * FROM Compensation" ‘ Create the recordset and link it to the command Set empCompRS = Server.CreateObject("ADODB.RecordSet") Set empCompRS.Source = empCompCmd empCompRS.LockType = adLockPessimistic empCompRS.Open … empCompRS.Close

Reusing Recordset Objects empCompRS.Close empCompCmd.CommandText = "SELECT * FROM Compensation ORDER BY Salary DESC" empCompRS.Open

Navigating Recordsets in ASP empCompRS.Move #rows empCompRS.MoveFirst empCompRS.MoveLast empCompRS.MoveNext empCompRS.MovePrevious empCompRS.EOF ‘ JJ’s favorite loop empCompRS.Open While(not empCompRS.EOF) DoMagic empCompRS.MoveNext Wend empCompRS.Close

Accessing Fields Moving data from the database to ASP Dim salary salary = empCompRS.Fields("salary").Value Moving data from ASP to the database... empCompRS.Fields("options").Value =

Creating and Editing Records Editing existing records empCompRS.Edit... empCompRS.Update Creating records ‘ Doesn’t matter where the record pointer is when you do this ‘ Make sure to ensure unique keys when adding records! empCompRS.AddNew... empCompRS.Update

Creating and Editing Records Example: For all the employees making less than $53,000/year: »Increase everyone’s salary by $5000/year »Decrease everyone’s stock options by 250/year Add an employee who makes $54,000 and receives 100 options each year

Putting it all together: Authoring ASP pages

ASP File Structure ASP commands go inside tags Script code goes inside tags Anything outside of these tags is HTML Comments inside ASP or Script code are prefaced by a single quote <% ‘ Good programmers write lots of comments! %>

A simple ASP file <% ' Simple ASP code that gives the appropriate greeting based on the time of day ' Get the time of day Dim currentTime currentTime = now ' Output the correct greeting based on whether it's morning, ' afternoon, or evening if(currentTime >= #5:00am#) AND (currentTime < #12:00pm#) then %> Good morning! = #12:00pm#) AND (currentTime Good afternoon! Good evening! The current time is

Now let’s design a system... An on-line store The story... What should our product be? How much should it cost? Orders taken via credit card and shipped via UPS

The design Design the database Design the HTML pages Tell me what the ASP code needs to do