Tài liệu Module 1: Displaying Data from a Database docx

40 540 0
Tài liệu Module 1: Displaying Data from a Database docx

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Contents Overview 1 Introducing Data-Driven Web Sites 2 Demonstration: Tour of the Sample Web Site 8 Retrieving Data from a Database 10 Lab 1.1: Retrieving Data from a Database 22 Demonstration: Creating a Detail Results Page 28 Lab 1.2: Creating a Detail Results Page 30 Review 34 Module 1: Displaying Data from a Database Information in this document is subject to change without notice. The names of companies, products, people, characters, and/or data mentioned herein are fictitious and are in no way intended to represent any real individual, company, product, or event, unless otherwise noted. Complying with all applicable copyright laws is the responsibility of the user. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Microsoft Corporation. If, however, your only means of access is electronic, permission to print one copy is hereby granted. Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.  2000 Microsoft Corporation. All rights reserved. Microsoft, BackOffice, FrontPage 2000, MS-DOS, Windows, Windows NT, and Windows 2000 are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A. and/or other countries. The names of companies, products, people, characters, and/or data mentioned herein are fictitious and are in no way intended to represent any real individual, company, product, or event, unless otherwise noted. Other product and company names mentioned herein may be the trademarks of their respective owners. Development Lead: Sonia Pande (NIIT) Instructional Designers: Sangeeta Nair, Vijayalakshmi Narayanaswamy; Shruti Jain, Geetnjali Arora, (NIIT) Technical Contributors: Scott Swigart (3 Leaf Solutions, LLC); Gary Gumbiner (Great Barrier Technologies, Inc.) Program Managers: Steve Merrill Graphic Artist: Scott Serna (Creative Assets) Editing Manager: Lynette Skinner Editor: Reid Bannecker (S&T Onsite) Copy Editor: Reid Bannecker (S&T Onsite) Production Manager: Miracle Davis Production Coordinator: Jenny Boe Production Tools Specialist: Julie Challenger Production Support: Susie Bayers (Online Training Solutions, Inc.) Test Manager: Sid Benavente Courseware Testing: Eric Myers Creative Director, Media/Sim Services: David Mahlmann Web Development Lead: Lisa Pease CD Build Specialist: Jenny Boe Online Support: Debbi Conger Manufacturing Manager: Rick Terek Operations Coordinator: John Williams Manufacturing Support: Laura King; Kathy Hershey Lead Product Manager, Release Management: Bo Galford Lead Product Manager, Internet Services: Hilary Vandal Group Manager, Courseware Infrastructure: David Bramble Group Product Manager, Content Development: David Bramble General Manager: Robert Stewart Module 1: Displaying Data from a Database iii Instructor Notes The module takes students on a tour to a sample intranet site and introduces a case study of a fictitious company. The module introduces the components of Web site architecture and database architecture. This module also teaches students the procedure for retrieving records from a database by importing the database to the current Web and establishing a connection with a database by using the Database Results Wizard. The procedure for displaying data from a database by specifying the rows and fields to be displayed, and selecting the formatting options for database results are also covered. Finally, the module teaches students how to create a detail results page. After completing this module, students will be able to: ! Understand the need for a data-driven Web site. ! Identify the components of Web site architecture. ! Describe the database architecture. ! Retrieve records from a database. ! Specify the data to be displayed. ! Create a detail results page. Materials and Preparation This section provides you with the required material and preparation tasks that are needed to teach this module. Required Material To teach this module, you need the following materials: ! Microsoft PowerPoint file 1932A_01.ppt. ! Module 1, “Displaying Data from a Database” ! Lab 1.1, “Retrieving Data from a Database” ! Lab 1.2, “Creating a Detail Results Page” Preparation Tasks To prepare for this module, you should: ! Read all the material for this module. ! Complete the lab. Presentation: 65 Minutes Labs: 55 Minutes iv Module 1: Displaying Data from a Database Module Strategy Use the following strategy to present this module: Start the module with an introduction of data-driven Web sites. Show them some real examples of data driven Web sites. After the introductory topics are over, take them through the sample site and tell them that they will create the Personal Data part of the intranet site. Demonstrate the procedures using the Database Results Wizard, while explaining each option and telling them under what situation they would be using each option. It is very important to tell them real examples of why they would create a particular page. Module 1: Displaying Data from a Database 1 # ## # Overview ! Introducing Data-Driven Web Sites ! Demonstration: Tour of the Sample Web Site ! Retrieving Data from a Database ! Lab 1.1: Retrieving Data from a Database ! Demonstration: Creating a Details Results Page ! Lab 1.2: Creating a Details Results Page ! Review Data-driven Web sites are some of the most useful resources on the Internet. They enable users to update and retrieve information from an underlying database. Microsoft FrontPage 2000 makes it easy to collect and display data on Web pages and create a Web database application. In order to use the information in a database on your pages, you need to create a database connection. FrontPage helps you establish a database connection by using the Database Results Wizard. The Database Results Wizard allows you to specify the data to be displayed, select formatting options, and specify the methods of displaying records. After completing this module, you will be able to: ! Understand the need for a data-driven Web site. ! Identify the components of Web site architecture. ! Describe the database architecture. ! Retrieve records from a database. ! Specify the data to be displayed. ! Create a detail results page. Slide Objective To provide an overview of the module topics and objectives. Lead-in In this module, you will learn about dynamic Web sites and how to display results from a database by establishing a database connection. 2 Module 1: Displaying Data from a Database # ## # Introducing Data-Driven Web Sites ! Components of a Data-Driven Web Site ! Database Architecture ! Interacting with Databases The Internet has grown at a phenomenal pace since its inception. It has evolved from static text pages to dynamic and interactive Web sites. A dynamic Web site incorporates elements, such as scripts and database connectivity, to add features and functionality to pages. Incorporating these features into a Web page requires extensive programming skills. FrontPage 2000 provides you with a graphical user interface (GUI) environment for creating and managing dynamic and interactive Web sites. Using FrontPage 2000, you can connect your Web site to a database. A site that enables users to search, retrieve, and update data in a database is a data-driven Web site. As a result of the enhanced functionality that data-driven Web sites bring about, they have become the most useful resources on the Web. Examples of data-driven Web sites include online commerce sites that facilitate shopping on the Web by connecting databases, such as inventory and stock, to the Web site. Also, sites such as corporate intranets, which allow employees to retrieve information from the company databases connected to the site, are categorized as data-driven Web sites. Some examples of data-driven Web sites include http://www.hotmail.com , http://www.expedia.com , and http://www.microsoft.msdn.com. Slide Objective To provide an overview of the topics in the section. Lead-in In this module, you will identify the need for a data- driven Web site. You will also identify the components of Web site architecture and database architecture. Module 1: Displaying Data from a Database 3 Components of a Data-Driven Web Site The architecture of a data-driven Web site consists of three major components, Web browser, Web server, and database. Web browser The Web browser is an Internet client program that uses hypertext transfer protocol (HTTP) to make requests of Web servers on behalf of the user. Web server The Web server is a program that uses the client/server model and HTTP to generate the files that form Web pages for users. The Web server is responsible for managing and delivering the content that you wish to make available over the Web. The Web server takes a large repository of information from a database and makes it easily available to users. Some of the common Web server software includes Microsoft IIS, Microsoft Personal Web Server, and Apache. Database Every organization maintains data pertaining to its business, employees, and finances. This data needs to be accessed, maintained, and updated on a regular basis. Data is stored in a database in the form of tables. A database is a collection of information that is related to a particular subject or purpose, such as tracking customer orders or maintaining employee details. Slide Objective To identify the components of the Web site architecture. 4 Module 1: Displaying Data from a Database How a data-driven Web site works In a data-driven Web site, data is retrieved from an underlying database by using scripts, such as active server pages (ASP) that run on a Web server. A user connects to a Web server using a browser. The server receives the request and processes the request by using ASP. ASP connects to a database and retrieves data from the database. It then sends the results in HTML format to be displayed in the client browser. FrontPage 2000 uses ASP internally to extract data from a database. Therefore, you do not need expertise in ASP, in order to create a data-driven Web site. Module 1: Displaying Data from a Database 5 Database Architecture A database is a collection of data stored in the form of tables. For example, personnel data for all the employees of an organization can be stored in the Employee table. Need for related tables A table is a set of records and fields that stores data in a database. However, if a table has a complex structure with a large number of fields, it can lead to data redundancy and inconsistency when adding, deleting, and updating the data. Consider an example of a table named Student that contains information about students in a batch along with their grades for each semester. Student data, such as student name and student ID, is repeated each time that the grades for students are recorded in different semesters. This results in data redundancy. Additionally, if the value in one field is to be updated, the same value has to be updated in multiple rows for that student. Otherwise, it would lead to data inconsistency across rows. To reduce redundancy and eliminate inconsistency in a table, you can break a complex table into simple and related tables. For example, you can break down the Student table and store student data, such as names and addresses in a table called Student Details and the grades in another table called Performance. When a database has related tables, it means that two or more tables contain one or more fields that are related to each other by one or more common fields. For example, each record in the Student Details table has a StudentID field that is related to the StudentID field in the Performance table. Slide Objective To provide an overview of database architecture. Lead-in A database is a collection of data that you can sort, search, add to, edit, and print when required. 6 Module 1: Displaying Data from a Database Interacting with Databases ! To display records of all the employees in the Employee table ! To update Anne Austin’s telephone number ! To delete the record of John Smith SELECT * FROM Employee SELECT * FROM Employee UPDATE Employee SET Phone="425-101-9000“ WHERE FirstName="Anne" AND LastName="Austin" UPDATE Employee SET Phone="425-101-9000“ WHERE FirstName="Anne" AND LastName="Austin" DELETE Employee WHERE FirstName="John" AND LastName="Smith" DELETE Employee WHERE FirstName="John" AND LastName="Smith" A relational database is a collection of related tables from which data can be accessed. To access data in relational databases, you use structured query language (SQL). SQL allows you to specify the data to be accessed in the form of queries. A query is an English-like statement sent by a client to the server. A query allows you to retrieve or update data in a database. The server processes the query, retrieves the data, and sends it back to the client. Displaying records from a table Consider the example of a database that contains records of all the employees in an organization stored in the Employee table. To obtain a list of all the employees in the organization, you can write the following SQL statement: SELECT * FROM Employee In the preceding code, the SELECT statement displays all the records in the Employee table, because the asterisk (*) indicates all records. Updating records in a table Consider a situation where an employee, Anne Austin, changes her telephone number. In this situation, you have to update a field in a record of the Employee table. For this, you will use the UPDATE statement as shown in the following code: UPDATE Employee SET Phone="425-101-9000" WHERE FirstName="Anne" AND LastName="Austin" Slide Objective To identify the queries used to interact with database. Lead-in In order to retrieve information from a relational database, you use queries. [...]... a database After importing a database to the current Web, you need to create a connection to the database to access information from a database on a site FrontPage provides the Database Results Wizard to create a connection to the database Delivery Tip Start the demo with a brief description of the Database Results Wizard Demonstrate the steps for creating a database connection Use the database that... extensive database or programming skills FrontPage uses Active Server Pages (ASP), which is a server-side scripting environment, to create dynamic Web pages FrontPage allows you to collect, store, and retrieve information from databases To access a database from within a FrontPage-based application, you need to connect to a database using the Database Results Wizard Module 1: Displaying Data from a Database. .. databases Retrieving data from a database involves the following steps: 1 Importing the database to the current Web 2 Establishing a connection with the database 3 Displaying data from the database FrontPage 2000 provides an easy way to create the Web pages that incorporate useful information from a variety of data sources Using FrontPage, you can create Web pages that collect or display data dynamically... save it in the fpdb folder 7 Click Yes to save the database in the fpdb folder Module 1: Displaying Data from a Database 13 Demonstration: Connecting to a Database by Using the Database Results Wizard Slide Objective To identify the procedure of connecting to a database by using the Database Results Wizard Lead-in The Database Results Wizard helps to establish a connection between a Web page and a. .. from a database ! Demonstration: Importing a Database to the Current Web ! Demonstration: Connecting to a Database by Using Database Results Wizard ! Demonstration: Displaying Selective Records from a Table ! Demonstration: Setting the Sort Order and Limiting Records ! Demonstration: Displaying Data as a List Lead-in FrontPage 2000 provides capabilities that help you to retrieve information from databases... change, click Submit to display the update page d In the navigation bar, click Personnel Data, and then click Laura to access the personnel data for this employee Point out to the students that the information has been updated 2 In the navigation bar, click Quarterly Reports to view the quarterly performance of the company 10 Module 1: Displaying Data from a Database # Retrieving Data from a Database. .. options, such as Bullet list, Numbered list, or Table, and then click Next 9 In step 5 of the Database Results Wizard, click Finish 10 Save the file as list.asp and view in the browser 22 Module 1: Displaying Data from a Database Lab 1 .1: Retrieving Data from a Database Slide Objective To introduce the lab Lead-in In this lab, you will add functionality to the Personal Data link in the sample intranet site... Submit, all matching records from the database are retrieved and displayed in the database results region ! Display selective records by creating a database search form 1 Open a new page in the existing web http://localhost/1932/Democode/Myweb 2 On the Insert menu, point to Database, and then click Results The Database Results Wizard appears 3 In step 1 of the Database Results Wizard, select Use an existing... step 4 of the Database Results Wizard, click Next to display the results in a table format 8 In step 5 of the Database Results Wizard, click Finish to split the results into specific groups and to close the Database Results Wizard ! Save and test in a browser 1 Save the Web page as default.asp 2 View the page in the browser Module 1: Displaying Data from a Database 15 Demonstration: Displaying Selective... Personnel Data link to view the employee details 27 28 Module 1: Displaying Data from a Database Demonstration: Creating a Detail Results Page Slide Objective To demonstrate the procedure of creating a detail results page Lead-in You can create a detail results page and link it to the database results page Consider the example of a Web page that shows a list of employee names When you click a name on . information from databases. Module 1: Displaying Data from a Database 11 Demonstration: Importing a Database to the Current Web Importing a database into. site. Module 1: Displaying Data from a Database 5 Database Architecture A database is a collection of data stored in the form of tables. For example,

Ngày đăng: 11/12/2013, 14:15

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan