Alison Balteramp;#039;s Mastering Microsoft Office Access 1002003 [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Alison Balteramp;#039;s Mastering Microsoft Office Access 1002003 [Electronic resources] - نسخه متنی

Alison Balter

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید



Creating Data Access Pages


You can create data access pages in one of the following four ways:

  • Using AutoPage

  • Using a wizard

  • From an existing Web page

  • From scratch


Creating a Data Access Page Using the AutoPage Feature


To create a data access page using AutoPage, follow these steps:


  • Click Pages in the list of objects in the Database window.

  • Click the New button in the Database window. The New Data Access Page dialog box appears.

  • Choose the table or query on which you want to base the data access page.

  • Select AutoPage: Columnar from the list of options for creating a data access page (see Figure 26.9).

    Figure 26.9. The New Data Access Page dialog box allows you to select the method you want to use to create a data access page.

  • Click OK. Access creates the data access page (see Figure 26.10).

    Figure 26.10. A data access page based on the Employees table using the AutoPage feature.


  • Creating a Data Access Page Using a Wizard


    To create a data access page using a wizard, follow these steps:


  • Click Pages in the list of objects in the Database window.

  • Double-click the Create Data Access Page By Using Wizard option. The Page Wizard appears.

  • Select the table or query on which you want to base the data access page. In Figure 26.11, the Employees table is selected.

    Figure 26.11. Selecting the table or query and the fields that you want to include in the data access page.

  • Select the fields that you want to appear on the data access page. In Figure 26.11, the EmployeeID, FirstName, LastName, Title, BirthDate, HireDate, HomePhone, and Extension fields are selected. Click Next to continue.

  • Add any desired grouping levels to the page (see Figure 26.12). In Access 2000, the created page was rendered not editable when grouping was applied. Fortunately, this is no longer the case in Access 2002 and Access 2003! Click Next to continue.

    Figure 26.12. Adding grouping levels to the data access page.

  • Select a sort order for the records included on the page (see Figure 26.13). In the figure, the page is sorted by the LastName field combined with the FirstName field. Click Next to continue.

    Figure 26.13. Selecting a sort order for the records on the page.

  • The last page of the wizard asks you for a title for the page. You can also opt to apply a theme to the page. Enter the title, select whether you want to apply a theme, and then designate whether you want to open the page or modify the page's design. Click Finish to complete the process. If you clicked the check box to apply a theme to the page, the Theme dialog box appears (see Figure 26.14). Select a theme and click OK. Figure 26.15 shows the completed page in Design view. Figure 26.16 shows the completed page in Page view.

    Figure 26.14. The Theme dialog box allows you to apply a theme to the page.


    Figure 26.15. A completed data access page in Design view.


    Figure 26.16. A completed data access page in Page view.


  • Access does

    not store data access pages in your database file or project. Instead, Access saves data access pages as HTML files. To save a data access page, follow these steps:


  • Click Save on the toolbar. The Save as Data Access Page dialog box appears (see Figure 26.17).

    Figure 26.17. The Save As Data Access Page dialog box allows you to select a name and location for the saved HTML document.

  • Enter the name of the HTML document. In the figure, the name is entered as pagEmployee. Click Save.

  • A dialog box appears, suggesting that the connection string should point to a UNC path. Doing so ensures that the data behind the page is available over the network.


  • Although Access saves the data access page as a separate document, it appears in the Database window (see Figure 26.18). Notice in the figure that a ToolTip appears, indicating the name and location of the saved HTML document. When you open the data access page from within Microsoft Access, it appears as a window within the Access environment. To view the page as it will appear in a browser, right-click the page in the Database window and select Web Page Preview.

    Figure 26.18. A completed data access page appears as an object in the Database window.


    Creating a Data Access Page from an Existing Web Page


    You might already have an HTML document that you have created. Fortunately, Access 2002 and Access 2003 allow you to base a new data access page on an existing HTML document. To create a data access page from an existing Web page, follow these steps:


  • Click Pages in the list of objects in the Database window.

  • Double-click the Edit Web Page That Already Exists wizard option. The Locate Web Page dialog box appears (see Figure 26.19).

    Figure 26.19. The Locate Web Page dialog box allows you to open an existing HTML document for editing within the Access environment.

  • Select an existing HTML document and click Open. You can now edit the page right within the Microsoft Access environment.


  • Creating a Data Access Page from Scratch


    Although the Data Access Page Wizard is very powerful, there are times when you will want to build a data access page from scratch. You would do this, for example, when the page you were creating was either very simple, or in no way resembled the output from the Page wizard. To create a page from scratch, follow these steps:


  • Click Pages in the list of objects in the Database window.

  • Double-click the Create Data Access Page In Design View option. You receive the warning shown in Figure 26.20. If you create a data access page in Access 2003, you will not be able to open it in Design view in Access 2000 or Access 2002. If you have installed the Microsoft Office 2003 Web Components, you can open the page in Page view in Access 2000 and Access 2002.

    Figure 26.20. A warning appears indicating that you will not be able to work with the design of the page in previous versions of Access.

  • Click OK. A blank data access page appears (see Figure 26.21).

    Figure 26.21. When the Create Data Access Page in Design View option is used, a blank data access page appears.

  • Add controls to the data access page and set their properties.


  • You might wonder how to associate a table from your database with a data access page that you build from scratch. The process differs somewhat from the process of associating a form with data. The process is as follows:


  • Click the Field List tool on the toolbar. The Field List window appears (see Figure 26.22).

    Figure 26.22. The Field List window allows you to easily add table and query fields to your data access pages.

  • Notice that the Field List window shows two expandable lists: one with the tables in the database, and the other with the queries in the database (see Figure 26.23).

    Figure 26.23. The expanded Field List window shows you all the tables and queries within the current database.

  • To add all fields from an existing table or query to the data access page, drag an entire table or query from the field list to the data access page.

  • To add specific fields from a table or query to the data access page, expand the field list to display the desired table or query, and then drag and drop individual fields to the data access page. In Figure 26.24, selected fields have been added from the Employees table to the data access page.

    Figure 26.24. A data access page containing selected fields from the Employees table.


  • NOTE

    Because data access pages are stored as separate HTML documents, Access will not be able to locate the data access pages associated with a database if the pages are deployed to a different directory structure than the structure that existed when they were first created. You must write code to "fix" the links to the pages. The Northwind.MDB database that ships with Access 2003 contains sample code that you can use in your applications to fix these broken associations.


    / 544