Understanding Access s Dynamic HTML Implementation

Understanding Access's Dynamic HTML Implementation

If you're new to authoring dynamic Web pages, you first must grasp the terminology used by DAP. Internet-related terminology is replete with three- to five-letter acronyms (TLA and 5LA) that belie the complexity of the underlying technology. If you're conversant with DHTML basics, skip to the "Getting Acquainted with Page and Page Design Views" section. If you've worked with DAP in Access 2000 or 2002, you can move ahead to the "Modifying the Design of AutoPage DAP" section.

Dynamic HTML doesn't currently have the status of an Internet standard, so DHTML implementations vary among browser publishers and versions. In this book, an Internet standard is defined as a World Wide Web Consortium (W3C) Recommendation or an Internet Engineering Task Force (IETF) Request for Comment (RFC). Most of today's W3C and IETF standards represent consensus among the groups' voting members vendors plus a few governments and universities not the Internet community as a whole.

Technologies Supporting DHTML and DAP

The following is a brief list of the W3C Internet standards and proprietary Microsoft technologies that provide the foundation for Microsoft's implementation of DHTML and its use of DAP:

  • graphics/globe.gif Document Object Model (DOM) 2.0 a W3C recommendation adopted on November 13, 2000. The complete set of recommendations is available at http://www.w3.org/DOM/. DOM consists of a Core component (DOM Core) that supports Extensible Markup Language and provides the underpinnings for DOM's HTML component (DOM HTML). Other components include Views, Style, Events, Traversal-Range, and HTML; the HTML component was a working draft when this book was written. Microsoft's "Dynamic HTML Overview" article, at http://msdn.microsoft.com/workshop/author/dhtml/dhtmlovw.asp offers a brief introduction to the relationship between DOM and DHTML.

  • Extensible Markup Language (XML) 1.0 a W3C Recommendation dated February 1998. As mentioned earlier, DAP use XML for embedding database connection strings and as a read-only data source. You also can embed XML data in DAP as an XML data island.

    For more information on XML 1.0, see "Gaining an XML Vocabulary," p. 944.


  • graphics/globe.gif Cascading Style Sheets (CSS) a W3C standard for specifying the onscreen presentation and printed format of HTML documents without the need to invent new HTML formatting tags. CSS rules let you specify the exact location of elements, such as blocks of text or images, as well as the color, type family, and font of text. The W3C adopted the CSS, Level 2 (CSS2), Recommendation in May 1998; you can read the complete W3C Recommendation at http://www.w3.org/TR/REC-CSS2/. DHTML lets you change CSS rules on the fly to specify the properties of an object in response to events, such as passing the mouse pointer over a headline or clicking a block of text. IE 5+ and Netscape 6+ support CSS Level 1 to a varying extent. Microsoft stated objective for IE 6.0 is to support "all the properties, values, and features in the CSS, Level 1 (CSS1) specification."

  • DHTML Behaviors Microsoft's approach to separating scripting code from HTML content. DHTML Behaviors let you store scripting code in HTML Component (.htc) files. Separating script from HTML content makes the page source code easier to read and lets you reuse standard event-handling procedures, such as highlighting text. Users must have IE 5+ installed to enable DHTML Behaviors on client PCs. DAP let you specify an .htc file as the value of the Behavior property of page objects.

  • OLE DB and ActiveX Data Objects (ADO) 2.1+ components that provide the underlying database connectivity for DHTML data binding and DAP. The Office 2003 setup program installs ADO 2.7. Chapter 30, "Understanding Universal Data Access, OLE DB, and ADO," explains these two related data access technologies.

    Fortunately, you don't need to fully understand the object models and syntax of the preceding technologies or possess HTML design skill to generate DAP with Access 2003. To modify the behavior or extend the usefulness of DAP, however, you must be at least conversant with VBScript or ECMAScript/JScript code.

Note

The examples in this and the next chapter use VBScript because of its similarity to VBA, which is the subject of Chapter 27, "Learning Visual Basic for Applications." VBScript is a subset of VBA, and many of the basic programming techniques described in Chapter 27 also apply to VBScript. Among commercial browsers, only IE supports VBScript. IE 5+ is required to create and display DAP, so the use of VBScript in place of the more widely supported ECMAScript isn't an issue in this case.


DOM HTML and DHTML

DOM HTML describes elements of conventional HTML Web pages as a collection of predefined hierarchical objects based on W3C-standard HTML tags. Listing 24.1 shows the HTML source for a simple three-column, three-row table with row-column (RnCn) text in each cell.

Listing 24.1 HTML Source for a Three-Column, Three-Row Table
 <html> <head> <title>New Page 1</title> </head> <body> <table border="1" width="100%">   <tr>     <td width="33%">R1C1</td>     <td width="33%">R1C2</td>     <td width="34%">R1C3</td>   </tr>   <tr>     <td width="33%">R2C1</td>     <td width="33%">R2C2</td>     <td width="34%">R2C3</td>   </tr>   <tr>     <td width="33%">R3C1</td>     <td width="33%">R3C2</td>     <td width="34%">R3C4</td>   </tr> </table> </body> </html> 

Figure 24.3 illustrates the object hierarchy of the HTML elements defined by Listing 24.1. Like the master-child relationships of forms and subforms, DOM defines parent-child(ren) relationships between objects and properties, which can also be collections of objects. The <HTML> tag defines the document parent object; the document object has a child <HEAD> element, which contains <META> and <TITLE> children; and a <BODY> element (body object), which contains all other elements of the page. The <TABLE> element contains a collection of <TR> row elements, each of which contains a <TD> data or column collection. Microsoft's DOM for the HTML that creates pages is much more complex than this example.

Figure 24.3. This diagram depicts the DOM object model for the table created by the HTML code of Listing 24.1.

graphics/24fig03.gif

Note

Microsoft's DHTML documentation and this chapter use the terms "element" (HTML tag pair) and "object" interchangeably.


DOM HTML also defines an event model for objects. The event model lets Web page authors specify what occurs when a page loads in your browser or when you click an element. Event-handling code, written in a scripting language, specifies the action taken when an event occurs. An object must have a unique Id property value, similar to the Name property of Access controls, to connect event-handling code to the object.



Special Edition Using Microsoft Office Access 2003
Special Edition Using Microsoft Office Access 2003
ISBN: 0789729520
EAN: 2147483647
Year: 2005
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net