Using Barcode maker for ASP.NET Control to generate, create UPC-A Supplement 5 image in ASP.NET applications.

www.OnBarcode.com

Microsoft Office Access 2003 Inside Out When you enter a facility ID, start date, and end date, and then click the Search button, the page passes parameters to the Reservations.asp Active Server Page. The page searches the Housing Reservations database and returns a result as shown in Figure 25-12.

Part 6: Linking Access and the Web

25 25 25 25 25 25

F25xx12.bmp

Figure 25-12. An Active Server Page that returns only the requested data.

When you know the parameters that an Active Server Page accepts, you can also enter the parameters as part of the URL. For example, if you want to see all the reservations for facility ID number 3 in the month of July 2003, you can enter the following in your Web browser s address field:

You might have noticed the question mark at the end of an Active Server Page name followed by a long string of data in the URL of many Web pages that you visit. Now you know that the string specifies parameters that tell the Active Server Page what you want returned to your browser.

Looking at Data Access Pages

You can use data access pages to present data on the Web in a very attractive way. You can actually convert most forms and reports that you have created into data access pages and use the pages for your Web sites instead of just exporting your data as static HTML or creating an ASP page. In Figure 25-13 you see the rptFacilities report from the Housing database. Note After you install the files from the sample CD, be sure to open the Housing Reservations database (Housing.mdb) before you attempt to open any of the Web pages you find in the Webs\DataAccessPages folder. Code in the startup form makes sure the connections in these pages point to the location where you installed the database file. 982

Part 1: Part Title

Publishing Data on the Web

F25QQ13

I opened this report in Design view in the Housing Reservations database and asked Access to save the report as a data access page. You can see the result in Figure 25-14.

F25QQ14

Figure 25-14. This Web page is hard to tell apart from the Access report.

The resulting page looks nearly identical to the report. If you look closely, you can see a small minus sign next to the Name caption near the top of the page. You can click the minus sign to shrink the detail display. Initially the page opens in its collapsed format and you must click the plus sign to see the expanded format shown in the figure. Notice that the page shows you 983

Part 6: Linking Access and the Web

25

25

25

25

Figure 25-13. The rptFacilities report in the Housing database.

25

25

Part 1: Part Title

Microsoft Office Access 2003 Inside Out the detail for rooms only 10 records at a time. You can click on the navigation bar below the detail listing to see more records. The page doesn t request the records from the database until you ask to view them. You will learn more about using data access pages in 27, Building Data Access Pages. You are now ready to dig in and see how to use Access for some of your Web needs. In the next few chapters we will delve deeper into the topics that were discussed in this chapter and see additional examples.

As you learned in the previous chapter, you have many options when you want to make data that you have stored in an Access application available on the Web. In this chapter, you ll learn about two of those options, static and dynamic Web pages. When you want to make relatively static data available in a Web page, you can export your data in HTML format. The Web page that you create in this way won t allow users to update the data, and your users will have limited search capabilities. However, you can create automated procedures in your application that make it easy to periodically update the Web page to ensure that it is current. If your data is more dynamic, you can create an Active Server Page (.asp). When you do this, the Web server queries your database each time a user visits the page, so the data displayed is always current. As you ll learn in this chapter, you can create a page that accepts input parameters and then opens your Active Server Page to present a filtered view of your data a custom query by form for the Web. Note

The examples in this chapter are based on the tables and data in the Housing Reservations database (Housing.mdb). You can find the sample Web pages in the \Webs\StaticHTML and \Webs\ActiveServerPages folders on your companion CD.