About the types of Web pages Access creates

Microsoft Office Access 2003

A data access page is a Web page that is connected directly to the data in your database. Use these pages to view, edit, update, delete, filter, group, and sort live data from either an Access database or a Microsoft SQL Server database, in Microsoft Internet Explorer 5.01 with Service Pack 2 (SP2) or later. A page can also contain components such as a spreadsheet, a PivotTable list, or a chart.

You create a data access page as a database object that contains a shortcut to the location of the page's corresponding HTML file.

Data access pages can also be saved as HTML Application (HTA) files. HTA files allow you to use Dynamic HTML (DHTML) technology "out of the browser" to write stand-alone applications. With HTA, you can write an application the same way you write a Web page with DHTML and script, or you can take content originally authored for the Web and turn it into an application. "Out of the browser" means that HTAs differ from Web pages in two important ways:

  • Your application is written completely in DHTML but runs in its own window without the browser menus and toolbars. This means your application fully defines the user interface.
  • Your application is fully trusted and free from the restrictions placed on Web pages for security reasons. Unlike Web pages, which run when visited, users will need to trust your HTA; however, once installed and run, your HTA can potentially do anything any program can.

More information about HTA files can be found on Microsoft's MSDN site on the Web.

Making your data access pages available

To make your pages available on the World Wide Web, you publish the pages to Web folders or to a Web server. You must also make the Access database or SQL Server database available to users of the page.

Internet Explorer needs to download the page only once from the Web server to let you view and interact with the data on the page. Because a page uses DHTML, access to the database is generally very efficient in a client/server environment.

The Access or SQL Server database that is the OLE DB data source for a data access page must be on a shared server or computer in order for users to view and interact with the page in a Web browser or in a mail message.

It's a good idea to place the database on a shared server or computer before you create your page. If you move the database that the page is connected to after you create the page, you must change the OLE DB data source connection of the page in the Connection dialog box of the data access page.

Although the data source of a page can only be an Access or SQL Server database, you can make other data formats accessible from a page by using linked tables from an Access database.

To further help protect your data access pages, you must put the Access or SQL Server database on the same Web server as the data access page.

Important  Make sure you use a universal naming convention (UNC) path, instead of relying on the drive letter of a mapped network drive in Windows Explorer when you are setting up the data source to the page. A drive letter can vary on a computer or may not always be defined, whereas a UNC path is a reliable and consistent way for the page to locate the data source.

Supporting files and Web links

When you create a data access page, Access manages the related files and plans the links and hyperlinks so that the images appear and the links work when the pages are placed on the final Web server.

When you save your file as a data access page in Design view, all supporting files— such as bullets, background textures, and graphics— are by default organized in a supporting folder. If you move or copy your data access page to another location, you must also move the supporting folder so that you maintain all links to your page.

For example, suppose you have a page called Page1.htm. It includes bullets, which are stored in a supporting folder called Page1_files. If you move Page1.htm, you must also move the supporting folder (Page1_files) to the new location.

By default, the name of the supporting folder is the name of the data access page plus an underscore (_), a period (.), or a hyphen (-), and the word "files." The word "files" will appear in the language of the version of Microsoft Office used to save the file as a data access page. For example, if you use the Dutch language version of Office to save a file called Page1 as a data access page, the default name of the supporting folder would be Page1_bestanden.

After you have published your data access page to the Internet or an intranet, you should test it in a Web browser. Make sure that all the graphics are displayed and that hyperlinks go to the correct destinations.

ShowDynamic (server-generated) HTML

You can create dynamic (server-generated) HTML files, either ASP or IDC/HTX, from tables, queries, and forms. Server-generated HTML files are displayed in a table format in a Web browser. Use server-generated HTML files when you want to use any Web browser. Server-generated HTML files are also useful if you need to see live data in a table connected to an ODBC data source, but you only need read-only access to the data.

Once you have output a datasheet to ASP or IDC/HTX format, you need to publish the files to make them available on the World Wide Web.

Each time a user opens or refreshes an ASP or HTX file from a Web browser, the Web server dynamically creates an HTML file, and then sends that HTML file to the Web browser.

If you create a server-generated HTML file from a datasheet that contains a parameter query, Access simulates the Enter Parameter Value dialog box by creating an additional HTML parameter page that contains an HTML form text box control for entering the parameter value, and a button for running the query. You must explicitly define the parameter data types when you create the parameter query. You must also display this HTML parameter Web page before you display the datasheet Web page. During the export operation, Microsoft Access executes the query and displays the Enter Parameter Value dialog box, but you can just click OK because the input is ignored.

Table or datasheet fields with a Hyperlink data type are output in HTML files as strings by using the following hyperlink address format: displaytext#address#subaddress#screentip. Although you cannot click the string in a Web browser to follow the hyperlink address, you can copy and paste the address portion into the address bar of the Web browser.

Differences between ASP files and IDC/HTX files

You can save table, query, or form datasheets as IDC/HTX files that generate HTML documents by querying your database for current data.

You can save forms as ASP files that emulate most of the functionality of the original form and display data from your database on a Web server. Most of the controls on your form are saved as ActiveX controls that perform the same or similar functions. None of the Visual Basic code behind your forms or controls is saved or run when the ASP file is created or activated. You can also save tables, queries, and form datasheets as ASP files that display the current data from your database.

How your Web server processes IDC/HTX files

When you output a table, query, or form as IDC/HTX files, instead of as an .html file, Access creates an HTML extension file (.htx). and an Internet Database Connector file (.idc). Internet Database Connector (httpodbc.dll) is a component of Microsoft Internet Information Services (IIS).

The .idc file contains a query in the form of an SQL statement and information that IIS uses to connect to an ODBC data source such as an Access or SQL Server database. The connection information includes the data source name and often a user name and password.

The .htx file is an HTML file that contains formatting information and placeholders indicating where to insert the values returned from the query in the .idc file.

After you publish your IDC/HTX files to a Web server, IIS can open the database (by using the appropriate ODBC driver and the .idc file connection information), run the query in the .idc file to access the data, merge the results and the .htx file into one .html file, and send the dynamically created .html file to the Web browser as a Web page.

How your Web server processes ASP files

On the other hand, when you output a table, query, or form as an ASP file, instead of as an .html file, Access creates a Microsoft Active Server Page (.asp) file. Active Server is a component of Microsoft Internet Information Server 3.0 or later.

The .asp file contains HTML tags interspersed with one or more queries in the form of SQL statements, template directives, and Microsoft Visual Basic Scripting Edition (VBScript) code containing references to ActiveX server controls. The .asp file also contains ODBC connection information to connect to an ODBC data source; in this case, an Access or SQL Server database. The connection information includes the data source name and often a user name and password.

After you publish your ASP files to a Web server, IIS can run the VBScript code, call the ActiveX server controls, open the database (by using the appropriate ODBC driver and the .asp file connection information), run the queries in the .asp file to access the data, merge the results and HTML tags in the .asp file into one .html file, and then send the dynamically created .html file to the Web browser as a Web page.

ShowStatic HTML

You can create static HTML files from tables, queries, forms, and reports. In a Web browser, reports are displayed in a report format. Tables, queries, and forms are displayed in a datasheet format. Use static HTML files when you want to use any Web browser that supports HTML version 3.2 or later and if your data does not change frequently.

To make your static HTML files available on the World Wide Web, you publish the files to Web folders or a Web server.

When you access the data through a Web browser, the browser needs to download the static HTML file only once from the Web server to let you view the data. There is no ODBC data source connected to the static HTML file, and if your data changes, you must export your files again to be able to view new data in a Web browser.

ShowHTML template files

You can use one or more HTML template files to enhance the appearance, consistency, and navigation of your static HTML and server-generated HTML files. For example, you might want to include a company logo in the header section and your own navigation buttons in the footer section of a static HTML report.

An HTML template is a text file that includes HTML tags and tokens that are unique to Access. These tokens indicate where to insert output and other information in the static HTML or server-generated HTML files.

When you output a table, query, form, or report using the Export command on the File menu and you specify an HTML template file in the Output Options dialog box, Access merges the HTML template file with the .html, .asp, and .htx output files by replacing the tokens (such as <!--AccessTemplate_Title-->) with the following:

<!--AccessTemplate_Title-->

Becomes the name of the table, query, form, or report placed in the title bar of the Web browser

<!--AccessTemplate_Body-->

The output of the table, query, form, or report

<!--AccessTemplate_FirstPage-->

An HTML anchor tag that links to the first page of a report

<!--AccessTemplate_PreviousPage-->

An HTML anchor tag that links to the page previous to the current report page

<!--AccessTemplate_NextPage-->

An HTML anchor tag that links to the next page after the current report page

<!--AccessTemplate_LastPage-->

An HTML anchor tag that links to the last page of a report

<!--AccessTemplate_PageNumber-->

The current page number

HTML template file example

<HTML>

<!--The following token places the object name in the title bar of the Web browser.-->

<TITLE><!--AccessTemplate_Title--></TITLE>

<!--The following HTML tag creates a different background color than the Web browser default.-->

<BODY BACKGROUND = "gray.jpg">

<!--The following token places all object output inside the <BODY> tag.-->

<!--AccessTemplate_Body-->

</BODY>

<BR><BR>

<!--The following four tokens create four navigation text buttons that jump to the first, previous, next, and last pages of a report.-->

<A HREF = "<!--AccessTemplate_FirstPage-->">First</A>

<A HREF = "<!--AccessTemplate_PreviousPage-->">Previous</A>

<A HREF = "<!--AccessTemplate_NextPage-->">Next</A>

<A HREF = "<!--AccessTemplate_LastPage-->">Last</A>

<!--The following token inserts the text "Page n" , where n is the current report page number.-->

<P ALIGN = CENTER>Page <!--AccessTemplate_PageNumber-->.</P>

<!--The following HTML tag adds a company logo to the bottom of the Web page.-->

<IMG SRC = "company_logo.jpg">

</HTML>