Creating a Data Access Page with AutoPage

If you are confident that everyone who will need to access your data on the Internet or an intranet will be using Internet Explorer version 5.0 or later, and that they will have Microsoft Office 2003 Web Components installed, you can take advantage of the special capabilities of data access pages. (Office 2003 Web Components is a set of ready-made controls that you use to work interactively with information in a data access page.)

A data access page is similar to a form, in that it can be used to view, enter, edit, or delete data from a Microsoft Access or a Microsoft SQL Server database. Like a form, a data access page is an Access object. Unlike a form, a page is not stored as part of your database: it is an external HTML file that is linked to your database in such a way that it makes the information in the database available over an intranet or the Internet. The window displayed when you click Pages on the Objects bar contains shortcuts to any pages you have created, and each page contains code that connects it to the appropriate database when the page is opened in Internet Explorer.

In Design view, a data access page looks somewhat like a form or report in Design view, but there are several differences.

  • In a form or report, the entire object is contained within the sections. In a data access page, the sections contain and control data that is bound to the database. The space above and below the sections is also part of the page, and you can place text and other controls in it.

  • The Field List for a form or report displays only the fields in the specific table or query to which the object is bound. The Field List for a data access page displays fields from all available tables and queries.

You can view a data access page in Access or in Internet Explorer. For example, suppose The Garden Company’s head buyer is visiting suppliers and she wants to check the store’s stock of particular kinds of gardening tools. She can connect to the Internet, start Internet Explorer, open an Inventory data access page, check current stock levels, and change the On Order field to show the number of items she is about to order from the supplier.

Important

To interact with and use the full functionality of a data access page, users must have Office 2003 installed on their computers. If they don’t, they can view the data but they can’t add, delete, or edit data.

There are four ways to create a data access page: in Design view, from an existing Web page, with the Page Wizard, or with AutoPage. AutoPage is the simplest method. Like AutoForm and AutoReport, AutoPage uses all the available fields and creates a simple page with minimal formatting.

In this exercise, you will create a data access page with which people can update entries in the Employees table in the GardenCo database through the Internet.

USE the GardenCo database in the practice file folder for this topic. This practice file is located in the My DocumentsMicrosoft PressAccess 2003 SBSPgsModsAutoPage folder and can also be accessed by clicking Start/All Programs/Microsoft Press/Access 2003 Step by Step.

OPEN the GardenCo database and acknowledge the safety warning, if necessary.

  1. On the Objects bar, click Pages.

  2. On the database window’s toolbar, click the New button to display the New Data Access Page dialog box.

    Important
    Important
  3. Click AutoPage: Columnar, click Employees in the list of tables and queries, and then click OK.

    A simple data access page is created and displayed in Page view.

    Important

    Every field in the underlying Employees table, along with its caption, is listed in one column. (AutoPage creates only columnar pages.) Below the fields is a navigation bar, which is included by default in all data access pages. (You might have to increase the size of the window to see this bar.)

  4. On the toolbar, click the Save button to save your new page.

    Important
  5. In the Save As Data Access Page dialog box, click Save to save the file in the practice file folder with the suggested name of Employees.

  6. If Access displays a warning message that the connection string for this page uses an absolute path, click OK to dismiss the message.

    Tip

    Because you are using a file on your own computer and not a network computer, a UNC path is not appropriate.

  7. Hold the pointer over each navigation button until a ScreenTip displays the name of the button.

  8. On the navigation bar, click the Next button to move to the next record.

    Tip
  9. Click the Help button.

    Tip

    Access online Help displays the topic About data access pages.

  10. Close Help.

  11. Click the Windows Start button, navigate to the My DocumentsMicrosoft PressAccess 2003 SBSPgsModsAutoPage folder, and double-click Employees to open it in Internet Explorer. Close the folder.

    The page should look and function the same as it did in Access.

    Tip

    You can view data access pages only in Internet Explorer 5.0 or later. (You must also have Internet Explorer 5.0 or later installed on your computer to create data access pages.) These exercises were developed using Internet Explorer 6.0. If you are using Internet Explorer 5.0, you might notice slight differences in the screens and in the options available.

  12. Click the Last Name field, and then on the navigation bar, click the Sort Ascending button.

    Tip

    The records are sorted in ascending order, based on the last name.

  13. Press to return to Access, and on the toolbar, click the View button to view the Employees page in Design view.

    Tip
    Tip
  14. Click the Close button in the upper-right corner of the Field List so that you can see the entire page window. You might have to scroll up.

  15. Click the placeholder text Click here and type title text, and type Employee List.

    The words are styled as Heading 1, indicated in the Style box on the Formatting toolbar.

  16. Press the key to move to the line below the heading.

    The Style box shows that this paragraph is styled as Normal.

  17. Type the following:

    While viewing this page, you can:

  18. Press , on the Formatting toolbar, click the Bullets button, and type the following lines, pressing after each:

    Tip

    Click Next or Previous to scroll records.

    Edit information.

    Click a field, and click one of the Sort buttons to sort records.

    Click Help for more information about using this page.

    Tip
  19. Double-click the word Next in the first bulleted item, and on the Formatting toolbar, click the Bold button.

    Tip
  20. Repeat step 20 for the words Previous, Sort, and Help in the bulleted list.

  21. Scroll down the page, click below the navigation bar, and type:

    Copyright 2003, The Garden Company.

    Tip

    You can add a © symbol by clicking where you want the symbol to appear, and then with turned on, holding down the key and typing 0169 on the numeric keypad. When you release the key, the copyright symbol is inserted.

  22. Select the line you just typed, on the Formatting toolbar, click the down arrow to the right of the Font Size box, and click 8.

    The size of the text changes to 8 points.

  23. Save the page, and then click the View button to switch to Page view.

    Tip
    Tip
  24. Return to Design view.

  25. Delete the Last Name label, drag the LastName text box to the right, and then drag both the FirstName text box and its label down until the text box is in line with the LastName text box.

  26. Click any blank spot to deselect the label and text box, then double-click the First Name label to open the Properties dialog box, click the Other tab, and change the InnerText property to Name.

    Tip

    You can also view the properties for an element of a data access page by clicking it and then, on the View menu, clicking Properties, or by right-clicking the element and, on the shortcut menu, clicking Properties. Pressing doesn’t toggle the display of properties for data access pages as it does with other objects.

  27. Click the View button to switch to Page view.

  28. Select the Employee ID number, and press three times.

    Tip

    The order in which the insertion point moves through the fields is determined by the TabIndex property.

  29. Switch back to Design view.

  30. Click the navigation bar at the bottom of the data access page. (You might have to move or resize the window to see the navigation bar.)

    The entire bar is selected, and its properties appear in the Properties dialog box.

  31. On the navigation bar, click the Delete button.

    Tip

    Only that button is selected, and its properties are displayed.

  32. In the Properties dialog box, click the Format tab to display the properties.

    Tip
  33. Scroll down, click the Visibility property, and then select hidden.

    This will prevent viewers from deleting records.

  34. On the toolbar, click the View button to change to Page view.

    The page is displayed, and the Delete button no longer appears on the navigation bar.

  35. On the toolbar, click the Save button.

  36. Press to switch to Internet Explorer, and click the Refresh button.

    Tip

    When the browser reloads the Web page, the Delete button is no longer available.

  37. Close Internet Explorer, and close the Employees page.

CLOSE the GardenCo database.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset