Introduction to the Database Results Wizard and Database Interface Wizard

FrontPage first introduced data access technologies with FrontPage 97's IDC/HTX database connectors. The technology was cryptic, and FrontPage's feature-set wasn't very robust. Developers struggled with adding the interactivity and dynamic content they wanted to their site. The result wasn't very pretty. Not many developers embraced data access with FrontPage, and those new to FrontPage and Web design didn't even bother to explore the features at all. Then Microsoft introduced Active Server Pages (ASP), and everything changed. Suddenly, data access was well within the reach of all Web developers. Sites started appearing all over the Internet that used ASP to connect to databases and provide site visitors with great dynamic content. The Internet had certainly changed, but FrontPage users were left in the dust. FrontPage 97 just didn't have the toolset to develop ASP pages very easily.

FrontPage 98 changed everything. Microsoft introduced the Database Region Wizard, and finally FrontPage users had ASP firmly in their grasp. Plenty of FrontPage users were developing Web sites that displayed data fed from a Microsoft Access or Microsoft SQL Server database. With the release of FrontPage 2000, the Database Region Wizard got a new name, the Database Results Wizard. It also got a few new features, but not many. Still, it was a good tool that enabled most FrontPage developers to design a data-driven Web site without knowing any code. It wasn't long, however, before FrontPage users had pushed the Database Results Region to its limit and were feeling the limitations of it bearing down on them. They were crying out for a suitable method for adding new records to their databases and for editing existing records. Enter the Database Interface Wizard.

FrontPage 2002 introduced the Database Interface Wizard, and for the first time, FrontPage developers had a full ASP toolset at their fingertips. Not only could they easily design Web pages to display data from their database, but they could also create a full-featured database editing system complete with password protection.

The Database Results Wizard

The Database Results Wizard, shown in Figure 36.1, is a five step wizard that makes it easy to insert a Database Results Region. A Database Results Region is a section of a Web page that displays dynamic data generated from a database. Very few users of the Database Results Wizard fully realize the potential of this tool.

Figure 36.1. The Database Results Wizard provides an easy interface for adding database interactivity to your Web site.

graphics/36fig01.gif

The Database Results Wizard has grown over the years. Beginning with FrontPage 2003, both ASP and ASP.NET, Microsoft's latest data-driven Web application development technology, are now supported. Using the Database Results Wizard, you can connect to many different data sources:

  • Microsoft Access database

  • Delimited text files

  • Microsoft Excel worksheet

  • Microsoft dBase files

  • Microsoft Paradox database

  • Microsoft Visual FoxPro

  • System data source (DSN) on the Web server

  • Microsoft SQL Server

  • Oracle (using Microsoft's ODBC provider)

  • Other data sources using a .dsn file, .udl file, or a custom connection string

For more information on ASP and ASP.NET, see "Data Access Technologies," p. 679.


Using the Database Results Wizard

The features of the Database Results Wizard go far beyond simply displaying database results such as those shown in Figure 36.2. Using the Database Results Wizard, FrontPage users can create complex pages that allow for searching databases and displaying appropriate records as well.

Figure 36.2. This page was generated with the Database Results Wizard.

graphics/36fig02.gif

When you insert a Database Results Region, FrontPage adds several files to your Web site. First, it adds the global.asa file, a file used by most ASP applications. The global.asa file stores information for use by the Database Results Wizard and also contains some functions that provide more functionality to the Database Results Wizard. FrontPage also adds several files to the _fpclass folder. The files that it adds differ depending on whether you use ASP or ASP.NET.

For information on how to insert a configure a Database Results Region, see "Using the Database Results Wizard," p. 709.


If you are using ASP, FrontPage adds the following files to the _fpclass folder:

  • fpdblib.inc This file contains numerous functions used by Database Results Wizard pages in order to provide for data access.

  • fpdbrgn1.inc This file contains ASP code used to format database results.

  • fpdbrgn2.inc This file contains ASP code that implements paging in Database Results Wizard pages.

graphics/new_icon.jpg

If you are using ASP.NET, FrontPage adds the following files to the _fpclass folder:

  • fpdbnet.cs A file written in C#, Microsoft's newest programming language, that contains common database functionality for ASP.NET pages.

  • dbregion.ascx This file is an ASP.NET user control, a control that can be reused easily in multiple pages. It implements the DataGrid that contains database results in ASP.NET pages generated by the Database Results Wizard.

  • dbquery.ascx This is another ASP.NET user control that is used to implement database queries in search forms inserted by the Database Results Wizard.

  • fputil.cs This is a C# file that contains ASP.NET code to format the database results.

In addition to these files, FrontPage also adds a file called web.config to your root folder when you create an ASP.NET page with the Database Results Wizard. This file contains configuration information for the ASP.NET application.

For more information on ASP and ASP.NET, see "Data Access Technologies," p. 679.


graphics/troubleshooting_icon.jpg

If you are unable to see the _fpclass folder in FrontPage, see "The _fpclass Folder Is Not Visible in FrontPage" in the "Troubleshooting" section of this chapter.


graphics/troubleshooting_icon.jpg

If you can see the _fpclass folder, but you don't see the files you expect in it, see "Files Aren't in _fpclass Folder" in the "Troubleshooting" section of this chapter.


Troubleshooting Database Results Applications

The global.asa file is responsible for storing information on database connections used by the Database Results Wizard. Therefore, the global.asa file must exist in the application root of the Web application. The application root is configured in Internet Information Services (IIS), and it indicates the top-level folder for the Web application. When you browse any ASP page, the Web server looks in the application root folder for a global.asa file. If it finds one, it runs certain code in that file to set up the Web application.

If the root folder of your Web site is not configured in IIS as an application root, you can get very strange results or error messages from your Database Results Wizard pages. To check for these types of problems, Microsoft provides a special ASP file called fpselect.asp that you can run. It will do automated diagnostics on your Web site to ensure that everything is configured as it should be. It will also allow you to run a test query against any of the database connections in your Web site.

Figure 36.3 shows the fpselect.asp file displaying a successful test against a Web site. Figure 36.4 shows a failure caused by the root folder of the Web site not being set as an application root. When your Database Results Wizard files don't run successfully, the fpselect.asp file can make troubleshooting much easier and will often tell you exactly what the problem is.

Figure 36.3. The fpselect.asp utility makes troubleshooting database pages easy. In this case, everything's fine.

graphics/36fig03.gif

Figure 36.4. The fpselect.asp utility has found a problem and told us what we need to know to fix it.

graphics/36fig04.jpg

NOTE

You can obtain the fpselect.asp file from Microsoft Product Support Services Knowledge Base article 294960 or from http://fpselect.frontpagelink.com.


Creating a Drill Down Search with the Database Results Wizard

As discussed previously, the Database Results Wizard can do much more than simply display database results. Figure 36.5 shows a page with a dropdown list that was populated from the Products table in the FrontPage sample database called fpnwind.mdb. When a product is selected and the button is clicked, another Database Results Region page is displayed with the details on the selected product as shown in Figure 36.6. All of this was done with the Database Results Wizard and without even looking at a single line of code!

Figure 36.5. This search page was created with the Database Results Wizard.

graphics/36fig05.gif

Figure 36.6. The details page displays details on the product selected, and it all happens without writing any code.

graphics/36fig06.gif

For more information on using the Database Results Wizard, see "Using the Database Results Wizard," p. 709.


The Database Interface Wizard

FrontPage 2002 introduced a new database tool to the FrontPage arsenal; the Database Interface Wizard. The Database Interface Wizard is a Web site wizard that can either be created as a new Web site or added to an existing Web site. You can insert multiple sets of Database Interface Wizard pages into a single Web site in situations where you have multiple database connections in a single Web site.

The Database Interface Wizard (shown in Figure 36.7) can connect to the same types of databases as the Database Results Wizard, but in addition to displaying the contents of the database, the Database Interface Wizard also provides the ability to edit database records, add new records, and delete existing records.

Figure 36.7. The Database Interface Wizard.

graphics/36fig07.jpg

The page shown in Figure 36.8 is the Database Editor created by the Database Interface Wizard. All the code necessary to run the Database Editor was generated automatically by the Database Interface Wizard. The Database Interface Wizard also allows you to password protect the Database Editor so that only those people with the password can edit, add, or delete records.

Figure 36.8. The Database Editor, created by the Database Interface Wizard, allows for editing of database records.

graphics/36fig08.gif



Special Edition Using Microsoft Office FrontPage 2003
Special Edition Using Microsoft Office FrontPage 2003
ISBN: 0789729547
EAN: 2147483647
Year: 2003
Pages: 443

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