Server Side Programming ASP1 Server Side Programming Database Integration (cont.) Internet Systems Design.

Slides:



Advertisements
Similar presentations
1 CSC 551: Web Programming Spring 2004 client-side programming with JavaScript  scripts vs. programs  JavaScript vs. JScript vs. VBScript  common tasks.
Advertisements

Languages for Dynamic Web Documents
Building Applications using ASP.NET and C# / Session 1 / 1 of 21 Session 1.
Server Side Programming ASP1 Server Side Programming Database Integration Peter O’Grady.
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.
ASP Application Development Session 3. Topics Covered Using SQL Statements for: –Inserting a tuple –Deleting a tuple –Updating a tuple Using the RecordSet.
15 Chapter 15 Web Database Development Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
B.Sc. Multimedia ComputingMedia Technologies Database Technologies.
Using Visual Basic 6.0 to Create Web-Based Database Applications
Kashif Jalal CA-240 (072) Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 2 of…
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.
CVEV 118/698 Active Server Pages Lecture 3 Prof. Mounir Mabsout Elsa Sulukdjian Walid El Asmar.
1 Active Server Pages Active Server Pages (ASPs) are Web pages ASP = server-side scripts + HTML The appearance of an Active Server Page depends on who.
Chapter 14: Advanced Topics: DBMS, SQL, and ASP.NET
Oral Presentation CSCE 330 ASP Tamiko Simmons Sherita Gee Robert Rhoden.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Beginning Active Server Pages Barry Sosinsky Valda Hilley Programming.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
MSSQL & ASP. Client-Server Relationship Client-Server Relationship HTML Basics HTML Basics Scripting Basics Scripting Basics Examples Examples.
Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Interacting With Data Databases.
4-1 INTERNET DATABASE CONNECTOR Colorado Technical University IT420 Tim Peterson.
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.
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.
Using Visual Basic 6.0 to Create Web-Based Database Applications
COLD FUSION Deepak Sethi. What is it…. Cold fusion is a complete web application server mainly used for developing e-business applications. It allows.
Elements of ASP Documents Adapted from MCDN Web Workshop ( and Webmonkey’s Introduction to Active.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
Web Design and Development for E-Business By Jensen J. Zhao Copyright 2003 Prentice Hall, Inc. Web Design and Development for E-Business Jensen J. Zhao.
Tutorial 10 by Sam ine1020 Introduction to Internet Engineering 1 Database & Server-side Scripting Tutorial 10.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Introduction to ADO Y.-H. Chen International College Ming-Chuan University Fall, 2004.
Active Server Pages and Application Service Providers Architecture for 2000 and beyond Krishen Kota Denali Technologies
Department of Computer Science 1 Web/Database Integration with Active Server Pages 17 May 2000 Seree Chinodom Computer Science Department.
Internet Programming ASP Sara Shahzad Dept. of Computer Science UOP.
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
How to Connect to Database ODBC (Open Database Connectivity) ADO (ActiveX Data Object) ASP Code To Connect to Database Recordset Object Navigating through.
Introduction to PHP Advanced Database System Lab no.1.
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
Producing a high-impact web experience by integrate Macromedia Flash and ASP By Katie Tuttle CS 330: Internet Architecture and Programming Project.
ASP. What is ASP? ASP stands for Active Server Pages ASP is a Microsoft Technology ASP is a program that runs inside IIS IIS stands for Internet Information.
Database Management Systems CS 420. Topics Outline 1. Introduction 2. HTML Review 3. VBScript 4. Access DBMS 5. Relational Database 6. Design Process.
Client-side & Server-side Scripting ©Richard L. Goldman August 5, 2003 Requires PowerPoint 2002 or later for full functionality.
1 Web/Database Integration with Active Server Pages 15th/16th October 1998 Nick Gould Faculty of Economic and Social.
CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)
Server Side Programming ASP1 Server Side Programming.
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.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
7-1 Active Server and ADO Colorado Technical University IT420 Tim Peterson.
January 27, 2001Database Tutorial1 Using a Database in ASP.
Using databases ActiveX Data Objects (ADO) Connecting to a database Reading data from a database Inserting, updating and deleting records Using databases.
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
ASP Mr. Baha & Dr.Husam Osta  What is ASP?  Internet Information Services  How Does ASP Differ from HTML?  What can ASP do for you?  ASP Basic.
Server Side Programming Database Integration
Introduction to Dynamic Web Programming
Active Server Pages Computer Science 40S.
ASP and Database Connectivity
PHP / MySQL Introduction
Web Development Using ASP .NET
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
Database Connectivity and Web Development
The need for server pages
Presentation transcript:

Server Side Programming ASP1 Server Side Programming Database Integration (cont.) Internet Systems Design

Server Side Programming ASP2 Overview n Review of Server Side Programming –ASP –VBScript n Advanced Database Interfacing with SQL –Insert –Delete –Update n Examples with Code

Server Side Programming ASP3 How can database be accessed by web browser? Web browser Server Side Programming e.g. Microsoft IIS server : ASP (VBScript, JScript, SQL) Internet Database

Server Side Programming ASP4 ASP Definition “Microsoft Active Server Pages (ASP) is a server-side scripting environment that you can use to create and run dynamic, interactive Web server applications. With ASP, you can combine HTML pages, script commands, and COM components to create interactive Web pages or powerful Web-based applications, which are easy to develop and modify.” - Microsoft’s Latest Definition

Server Side Programming ASP5 What are Active Server Pages? n Runs on IIS n Can provide compile-free application environment

Server Side Programming ASP6 ASP Basics n ASP file is a text file with the extension.asp n it contains any combination of: –Text –HTML Tags –ASP Script Commands/Components

Server Side Programming ASP7 ASP Script n ASP Script could be VBScript or Jscript (ECMAScript) n A script is a series of commands or instructions. n Script command instructs the web server to perform an action. n VBScript is similar to Visual Basic and Visual Basic for Application (VBA).

Server Side Programming ASP8 VBScript Basics n Not case sensitive n Declaring Variables VBScript does not require variable declarations, but it is good scripting practice to declare all variables before using them. To declare a variable in VBScript, use the Dim, Public, or Private statement.

Server Side Programming ASP9 VBScript Basics n VBScript Operators: –Arithmetic: +, -, *, /, ^ –Comparison: =, <>,, = –Logical (for Boolean variables): Not, And, Or, Xor

Server Side Programming ASP10 Running ASP n Ensure.asp extensions are enabled in IIS n Save.htm,.asp, and.mdb on server in same folder (or give full folder extensions of file locations in your code) n Client accesses the file in similar fashion to.htm (or.html) file n Server detects.asp extension and runs script within ASP tags n Results sent to client

Server Side Programming ASP11 Using ASP n Homework 2 review –HTML form took input from a list box and invoked the.asp file –The.asp file retrieved data from a database using VB script, SQL and displayed the results to the user n Homework 3 will expand on these concepts

Server Side Programming ASP12 Advanced Database Interfacing

Server Side Programming ASP13 Database Connectivity n When a database is tied to a web site,.ASP uses an object library called ActiveX Data Objects, or ADO –E.g. The Connection object: Set objConn = Server.CreateObject("ADODB.Connection") n Several ways to connect to a database – nts/DatabaseConnectionsFromASP.htmhttp:// nts/DatabaseConnectionsFromASP.htm

Server Side Programming ASP14 Structured Query Language n SQL is a standard computer language for accessing and manipulating databases n SQL (Structured Query Language) is a syntax for executing queries. But the SQL language also includes a syntax to update, insert, and delete records. –

Server Side Programming ASP15 Structured Query Language n These query and update commands together form the Data Manipulation Language (DML) part of SQL: n SELECT - extracts data from a database table n UPDATE - updates data in a database table n DELETE - deletes data from a database table n INSERT INTO - inserts new data into a database table

Server Side Programming ASP16 Homework 3 n 1 st part will involve inserting, deleting, and updating records in the database used in Homework 2

Server Side Programming ASP17 Examples of Insert, Delete, Update Statements  "INSERT INTO Products (Candy, Price) SELECT '" & candy & "'," & price &""  "DELETE FROM Products Where Candy = '" & candy & "'"  "UPDATE Products SET Price = " & price & " WHERE Candy = '" & candy & "'"

Server Side Programming ASP18 Example 1: Inserting Records  See  Only viewable in the ALF lab  Step 1: Create an Access Database

Server Side Programming ASP19 Example 1: Inserting Records  Step 2: Create a.html form Candy Candy: Price: $ Delete Candy

Server Side Programming ASP20 Example 1: Inserting Records  Step 3: Create the.asp file <% 'strSql will be the variable used to hold the sql statement string dim strSql Set MyConn = Server.CreateObject("ADODB.Connection") MyConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("Candy.mdb") 'grab the values from the form candy = Request.form("txtCandy") price = Request.Form("txtPrice") 'create the SQL statement that will insert the data to the table 'remember text values need single quotes wrapped around them strSql = "INSERT INTO Products (Candy, Price) SELECT '" & candy & "'," & price &"" MyConn.Execute strSql Response.Write "Added the candy with the sql statement: " & strSql Set MyConn = nothing %>

Server Side Programming ASP21 Example 1: Inserting Records  Step 4: Save the files to a folder in the wwwroot folder, run the example and view changes…notice Licorice was added to the Products table

Server Side Programming ASP22 Example 2: Deleting Records   Step 1: Create a.html form Candy Candy: Add Candy

Server Side Programming ASP23 Example 2: Deleting Records  Step 2: Create the.asp file <% 'strSql will be the variable used to hold the sql statement string dim strSql Set MyConn = Server.CreateObject("ADODB.Connection") MyConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("Candy.mdb") 'grab the candy name from the form candy = Request.form("txtCandy") 'create the SQL statement that will insert the data to the table 'remember text values need single quotes to wrapped around them strSql = "Delete FROM Products Where Candy = '" & candy & "'" MyConn.Execute strSql Response.Write "Deleted the candy with the sql statement: " & strSql Set MyConn = nothing %> Add Candy - Update Candy - Delete Candy

Server Side Programming ASP24 Example 2: Deleting Records  Step 3: Save the files to a folder in the wwwroot folder, run the example and view changes…notice Licorice was deleted from the Products table

Server Side Programming ASP25 Example 3: Updating Records   Step 1: Create a.html form Candy Gum Suckers Taffy Skittles M&Ms Lifesavers Snickers New Price:

Server Side Programming ASP26 Example 3: Updating Records  Step 2: Create the.asp file <% 'strSql will be the variable used to hold the sql statement string dim strSql Set MyConn = Server.CreateObject("ADODB.Connection") MyConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("Candy.mdb") 'grab the candy name from the form candy = Request.form("selCandy") price = Request.form("txtPrice") 'create the SQL statement that will insert the data to the table 'remember text values need single quotes to wrapped around them strSql = "UPDATE Products SET Price = " & price & " WHERE Candy = '" & candy & "'" MyConn.Execute strSql Response.Write "Update the candy price with the sql statement: " & strSql Set MyConn = nothing %>

Server Side Programming ASP27 Example 3: Updating Records  Step 3: Save the files to a folder in the wwwroot folder, run the example and view changes…notice Snicker’s price was changed from $4.00 to $0.25 in the Products table