Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 62 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
62
Dung lượng
0,94 MB
Nội dung
Contents Overview 1 Introduction to Data Access in Outlook2000 Solutions 2 Using Office Web Components 4 Using ADO 12 Retrieving Datafrom an ADO Data Source 17 Updating Data in an ADO Data Source 28 Accessing Exchange Server Information 37 Lab A: Searching and Retrieving Information in the Exchange Server Directory by Using ADSI 54 Review 57 Module11:AccessingDatafromtheOutlook2000Client 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. 1999 Microsoft Corporation. All rights reserved. Microsoft, Active Desktop, Active Directory, ActiveX, BackOffice, Developer Studio, FrontPage, JScript, MSDN, MSN, NetMeeting, Outlook, PivotChart, PivotTable, PowerPoint, Visual Basic, Visual C++, Visual FoxPro, Visual InterDev, Visual J++, Visual SourceSafe, Visual Studio, Windows, Windows Media, and Windows NT 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. Project Advisor: Janet Wilson Project Lead and Instructional Designer: Anne Bockman (Excell Data Corporation) Instructional Designers: Josh Barnhill (Volt Technical) and Jo Berry (Exchange) Lead Program Manager: Greg Bott Program Managers: Colleena Carr and Chris Boar (Intl Vendor) Graphic Artist: Andrea Heuston (Artitudes Layout and Design) Editing Manager: Lynette Skinner Editor: Jennifer Kerns (S&T Onsite) Copy Editor: Shari G. Smith (R & S Consulting) Online Program Manager: Arlo Emerson (Aditi) Production Support: Irene Barnett (Barnett Communications) Manufacturing Manager: Bo Galford Manufacturing Support: Mimi Dukes (S&T Onsite) Development Services: Kimber Dodge Lead Product Manager: Mary Larson Group Product Manager: Robert Stewart Module11:AccessingDatafromtheOutlook2000Client iii Instructor Notes Module11:AccessingDatafromtheOutlook2000Client This module describes how to access datafromthe Microsoft ® Outlook ® 2000 client. At the end of this module, students will be able to access data in a Microsoft SQL Server ™ database by using Microsoft Office Web Components and Microsoft ActiveX ® Data Objects (ADO). They will also be able to access data in the Microsoft Exchange Server directory by using theOutlook object model, Collaborative Data Objects (CDO), and Microsoft Active Directory ™ Service Interfaces (ADSI). Materials and Preparation This section provides you with the materials and preparation needed to teach this module. Materials To teach this module, you need the following materials: Microsoft PowerPoint ® file 1593a_11.ppt Module 11, “Accessing DatafromtheOutlook2000 Client” Preparation To prepare for this module, you should: Read all the materials for this module. Read the instructor notes and margin notes for the module. Complete the lab. Rehearse the demonstration. Presentation: 60 Minutes Lab: 45 Minutes iv Module11:AccessingDatafromtheOutlook2000ClientModule Strategy Use the following strategy to present this module: Introduction to Data Access in Outlook2000 Solutions Describe the different ways that SQL Server data and Exchange directory information can be accessed fromtheOutlook2000 client. Using Office Web Components Define the Office Web components. Show how to create a Web page that uses the Microsoft Excel PivotTable ® List control and Microsoft Access data access pages. Using ADO Provide an overview of OLE DB and describe its architecture. Then, explain where ADO fits in this architecture. Provide a high-level discussion of the main objects in the ADO object model. Define an ADO recordset and describe how it is used. Retrieving Datafrom an ADO Data Source Describe the steps required to connect to a data source and return a Recordset object. Once students have learned how to return a recordset, show some ways that they can work with it. Show how to reference fields in a recordset, explain how to use the Move methods to navigate through the records in a recordset, and how to use filtering to show only those records that meet a specified criteria. Finally, explain how to use the Command object to execute a stored procedure. Updating Data in an ADO Data Source Describe two ways to update data in an ADO data source: by using the Execute method of the Command and Connection objects, and by using a recordset. Accessing Exchange Server Directory Information Describe the purpose of the Exchange Server directory and the different ways that developers can access the information that is stored there. Discuss the objects in theOutlook object model that enable developers to access address book information. Introduce CDO as another way to retrieve address book information. Provide a definition of the Active Directory Service Interfaces (ADSI) and its provider-based model. Explain how to view the directory schema and why this is important to developing ADSI applications. Use the objects provided by ADSI to search the directory and update its contents. Module11:AccessingDatafromtheOutlook2000Client 1 Overview Introduction to Data Access in Outlook2000 Solutions Using Office Web Components Using ADO Retrieving Datafrom an ADO Data Source Updating Data in an ADO Data Source Accessing Exchange Server Information At the end of this module, you will be able to: Describe the different ways that data can be accessed fromthe Microsoft ® Outlook ® 2000 client. Add a Microsoft Office Web component that connects to an external data source to a Web page. Define the relationship between Microsoft ActiveX ® Data Objects (ADO) and OLE DB. Use ADO to connect to a data source, such as a Microsoft SQL Server ™ database, and retrieve datafrom that data source. Use ADO to add a new record to a data source. Define how Microsoft Active Directory ™ Service Interfaces (ADSI), the directory access functions, and the Collaboration Data Objects (CDO) library can be used to access the Microsoft Exchange Server directory. Slide Objective To provide an overview of themodule topics and objectives. Lead-in In this module, you will learn how to gain access to various types of datafrom your Outlook2000 solutions. 2 Module11:AccessingDatafromtheOutlook2000Client Introduction to Data Access in Outlook2000 Solutions Using SQL Server DatafromOutlook2000 Office Web components and data access pages Microsoft Visual Basic or Visual Basic for Applications and ADO in Outlook2000 Using the Exchange Server Directory fromOutlook2000 Outlook object model CDO ADSI Datafrom many different data sources, such as a Microsoft Access database, a SQL Server database, an Oracle database, a mainframe database, or an Exchange Server directory and information store, can be incorporated into your Outlook2000 solution through client-side data access. Using SQL Server DatafromOutlook2000 Two ways you can incorporate SQL Server data into your Outlook2000 solution include: Office Web Components and Data Access Pages. Microsoft Office Web components are Component Object Model (COM) controls that you can use to publish interactive spreadsheets, charts, Microsoft PivotTable ® lists, and databases for the Web. Data access pages are interactive Web pages that maintain a live link to a host Access or SQL Server database. With this live link, users can view, edit, and manipulate data within a browser window. These components can be placed in a folder home page or an Outlook2000 form to provide quick access to SQL Server data. Microsoft Visual Basic ® or Visual Basic for Applications and ADO in Outlook2000. Within Outlook 2000, you can use ADO from Microsoft Visual Basic, Scripting Edition (VBScript), Visual Basic for Applications, or a COM add-in. You can use ADO to view, manipulate, add, or delete records in a SQL Server database. Slide Objective To provide an overview of thedata access tools and technologies. Lead-in There are several ways that you can use client-side data access fromtheOutlook2000client to SQL Server and Exchange Server directory data sources. Module11:AccessingDatafromtheOutlook2000Client 3 Using the Exchange Server Directory fromOutlook2000The Exchange Server directory contains information that you can use in your Outlook2000 solutions. For example, you can use the objects contained in the directory to set up mailboxes or to obtain information about mail recipients. Several ways that you can access Exchange Server directory datafromOutlook2000 include: Outlook Object Model. TheOutlook object model provides objects that you can use to gain read-only access the Exchange Server address book. CDO. The CDO Library is an interface to MAPI that provides an easy method for gaining access to the directory information stored within an Exchange Server Global Address List (GAL). ADSI. ADSI is a set of specifications of COM objects and interfaces that you can use to manipulate Exchange Server directory services and other directory services. You can use the ADSI objects to perform common administrative operations, such as adding new users or managing a print queue. 4 Module11:AccessingDatafromtheOutlook2000Client Using Office Web Components Introduction to Office Web Components Publishing an Interactive Web Page from Excel Using Data Access Pages Using theData Source Control The Office Web components are COM controls that you can use to publish interactive spreadsheets, charts, PivotTable lists, and databases for the Web. Office Web components provide a way to quickly add data access capabilities to Outlook2000client applications. You can base these components on an external data source, such as a SQL Server database, and then add them to Outlook2000 forms or to folder home pages. Slide Objective To outline this topic. Lead-in Office Web components provide a way to quickly add data access capabilities to client side applications. Module11:AccessingDatafromtheOutlook2000Client 5 Introduction to Office Web Components Using Office Web Components in a Solution Create a worksheet, PivotTable, or chart in Excel Create a data access page in Access Add a reference to the Office Web Components Object Library Use the Office Web Components in ASP Capabilities of Office Web Components Spreadsheet, PivotTable List, Data Source, and Chart Office Web components enable you to incorporate spreadsheets, PivotTable lists, charts, and data access pages into a solution in a number of different ways. Using Office Web Components in a Solution You can use the Web components in your Outlook2000 solution in the following ways: Create a worksheet, PivotTable, or chart in Excel, and then save your work as an interactive folder home page. Create a data access page in Access and save it as an interactive folder home page. Add a reference to the Microsoft Office Web Components Object Library to your custom application by using any development environment that supports COM; then use the components as you would any other COM object through automation. Use the Office Web components in Active Server Pages (ASP), and then generate static Hypertext Markup Language (HTML) or interactive Web pages for display on the Internet or intranet client. With Web components, users can interact with a Web page from within a browser, while using many of the features that are found in the full version of the application. Slide Objective To describe the different ways that Office Web components can be used in a solution and to list the different components that are available. Lead-in Office Web components are implemented as COM controls, so they can be used from Web pages or any other development environment that supports COM. 6 Module11:AccessingDatafromtheOutlook2000Client Capabilities of Office Web Components The following table lists and describes the capabilities of each component. Component Description Spreadsheet Provides a recalculation engine, a full function library, and a simple spreadsheet user interface. A spreadsheet is created when a worksheet is saved with interactivity. PivotTable List Provides sorting, grouping, filtering, outlining, and pivoting capabilities. A PivotTable can connect to datafrom a spreadsheet range, a relational database, or a multidimensional database. It can be generated by Excel from a PivotTable object or designed with theData Access Pages Designer in Access. Data Source The reporting engine behind data access pages and the PivotTable component. Thedata source component manages data access with the database servers by, for example, retrieving records and managing the sorting, filtering, and updating of records. Chart Graphically displays information from a spreadsheet, a PivotTable, or thedata source component. A chart updates instantly in response to user interaction with the other components. Users must have Microsoft Internet Explorer version 4.01 (or later) and an Office 2000 license to browse a Web page interactively by using Office Web components. Note [...]... records 10 Module11:AccessingDatafromtheOutlook2000Client Using theData Source Control Slide Objective To describe the purpose of theData Source control and how it is used Lead-in TheData Source control is used to perform several tasks for data access pages, the PivotTable List control, and the Chart control Function of theData Source Control Used as the reporting engine Manages the connection... relational data sources such as Access, SQL Server, or Oracle databases Although theData Source control can provide data to the PivotTable List control, theData Source control cannot be bound to multidimensional data sources; transformations of relational data to multidimensional data are managed by the PivotTable Service Module 11:AccessingDatafromtheOutlook2000Client 11 Using theData Source... reference to the ADO Object Library To set the reference to the ADO Object Library: 1 On the Tools menu in the Visual Basic Editor, click References 2 Select Microsoft ActiveX Data Objects 2.1 Library, and then click OK This step is not necessary if you are using the ADO object model from within an Outlook2000 form Module 11:AccessingDatafromtheOutlook2000Client 17 Retrieving Datafrom an ADO Data. .. record The following table lists and describes when to use each of these move methods Method Use to Move Move the position of the current record by the number of rows you specify MoveFirst Make the first record the current record MoveLast Make the last record the current record Module 11:Accessing Data fromthe Outlook 2000Client 25 (continued) Method Use to MoveNext Make the next record the current... (ADO)” in Visual Basic Help Opening the Connection After you have specified an OLE DB data provider and have passed the connection information (if required), use the Open method to establish a connection to thedata source The following example opens the connection to the Northwind SQL Server database cnNorthwind.Open 20 Module11:Accessing Data fromthe Outlook 2000Client Creating a Recordset Object... End With In the code for the Open method, Customers is the name of the table and cnNorthwind is the name of the Connection object variable 22 Module11:AccessingDatafromtheOutlook2000Client Closing the Recordset and Connection Objects After you open a recordset and finish using it, you should close the recordset and release resources held by the object variables If you do not close the recordset,... Item.Application.CreateObject("ADODB.Connection") Module11:Accessing Data fromthe Outlook 2000Client 19 Setting Connection Properties The Connection object contains information about connections to OLE DB service providers Use the Connection object properties to specify the type of data source and other information that the OLE DB provider needs to connect to thedata source Property Description Provider Indicates the name of the OLE DB... using OLE DB data Any application that uses ADO is an OLE DB data consumer The examples in this module are written by using VBScript, and assume that an Outlook2000 form is thedata consumer 14 Module11:Accessing Data fromthe Outlook 2000Client Service Components Service components are components of OLE DB that process and transport data These components include query processors and cursor engines... Project (Existing Database), and then click OK c In the File New Database dialog box, enter a name for the database, and then click Create d In theData Link Properties dialog box, provide connection information for the SQL Server database e To make thedata access page read-only, click the Advanced tab of theData Link Properties dialog box, specify access permissions, and then click OK The default value... moved beyond the last record If rsCustomers.EOF Then rsCustomers.MoveLast End If End Sub In this example, if the user tries to move beyond the last record, the user is set back to the last record and the error is avoided Module 11:Accessing Data fromthe Outlook 2000Client 27 Filtering Records Slide Objective To show how to filter records Lead-in Filters enable you to temporarily limit the records . Stewart Module 11: Accessing Data from the Outlook 2000 Client iii Instructor Notes Module 11: Accessing Data from the Outlook 2000 Client This module describes. 2 Module 11: Accessing Data from the Outlook 2000 Client Introduction to Data Access in Outlook 2000 Solutions Using SQL Server Data from Outlook 2000