In This Site

Home
Free News Updates
Using Microsoft FrontPage
Cascading Style Sheets
Database Fundamentals
FrontPage & Access
FrontPage Navigation
Website Security
Solving Problems
Learning SQL
Code Samples
Promote Your Site

In This Section

Up
Database Results Basics
Passing Parameters
Main/Sub Forms
Displaying Images

The number one source for making your website sell!

 

 

 

 

FrontPage Tips by Ward Cameron Enterprises
Take Your Web Site to New Levels

Microsoft FrontPage's Database Results Wizard

Microsoft FrontPage offers one of the most user-friendly methods available for integrating database records with your Microsoft FrontPage website. There is NO better way to take your data to the Internet, regardless of whether it is Microsoft Access OR any other ODBC (Open Database Connectivity) data source.

This tutorial will introduce you to the basic features of this powerful tool. Once you've mastered these basics, you'll be ready to tackle some of the other tutorials in the "FrontPage & Databases" section of this website.

Remember, before you can begin this tutorial, you must import a database into your website. If you have not yet done this, click here to import your database.

To get started, open a blank page in FrontPage, and then select Insert-Database-Results from the program menu.

If the "Results" option is grayed out, then you may have one of several problems that you'll need to solve BEFORE you can work with online database files.

If any of the following are true, you won't be able to insert database results:

  •  If you are working on a web that is located on your local computer, you will need to have Microsoft Personal Web Server OR Internet Information Server running before you will be able to work with active server pages. If you need to work on a remote site, log directly on to the site, rather than work on your disk-based site. Working live will also allow you to see the results of changes right away, rather then have to wait until you publish your site.
  • if the website is NOT hosted on an ASP capable site, you will not be able to work with the DRW.

Once you have solved these challenges, you should see the Database Results Wizard (DRW) window open to display the following window.

Step 1 of the DRW provides three options. If you select "Use a sample database connection", FrontPage will import the Northwind database that is included with Microsoft Access and Frontpage, and create a database connection that you can work with.

If you have already imported a database into your web, for instance the northwind database, then you will be able to select it from the list of existing database connections.

Finally, if you have a database file that you have yet to import, you can select "Use a new database connection". This will walk you through the steps of importing your database file and setting up a connection to it.

Once you have a working database connection, you will always use the option to "Use an existing database connection". DO NOT import a database more than once.

Once you've selected your database option, click next.

Step 2 offers two options. You can either select a Record Source, which can be either a database table OR a saved database query. As an alternative, advanced users can type in custom SQL query code by selecting the "Custom query" option. For the purposes of this tutorial, we will select "Alphabetical List of Products" under the Record Source. Click Next.

In Step 3, you have the option of customizing the field values that will be displayed on your database page. By default, the page will include ALL the fields in the source table or query. Click on the Edit List button to open the Displayed Fields window. By default, all of the fields will be listed under the Displayed Fields column. Remove all of the fields with the exception of ProductID and ProductName. You do this by selecting them one by one and clicking the Remove button (double clicking the field will accomplish the same task). Once you have only the two fields listed, click OK to return to Step 3.

Now, while we are still on Step 3 of the DRW, click the More Options button to open up the More Options window.

This window allows you to set several options for your database results page. Advanced users can set criteria. This will force the DRW to limit the results it displays to those matching specific criteria. We'll save this for a later tutorial.

This screen also allows you to limit the number of results displayed. This can be helpful if you have a large database and want to speed up the operation. Keep in mind though that this can also result in some data NOT being available online.

FrontPage displays a specific message if your DRW page does not find any data to display. By default, you'll see "No Records Returned" shown. You can change this to any message you wish.

The Defaults button is grayed out in this example. Were you using custom SQL code, you would be able to set default values for all of your fields using the Defaults screen. We'll save that for a more advanced tutorial later.

Finally, the Ordering button allows you to set the sort order for your DRW page. Click the Ordering button now to open up the Ordering window.

You can set the sort order any way you wish on this screen. When you add a field name, it will default to sorting in ascending order (indicated by a yellow arrow pointing up). If you double click on the field name OR press the Change Sort button, it will change to descending order (a yellow arrow pointing down).

Set your example to sort by ProductName in ascending order. Click the OK button to return to Step 2 of the DRW and then click next to move to Step 4.

In Step 4, you decide how you want your data displayed. By default, you'll see "Table - one record per row" selected. Also by default, it selects "Use table border", "Expand table to width of page", and "Include header row with column tables.

This tabular format is best used when you have data that you want to list in an excel-like table. Contact information is a good example. This is also used in order to create a list of database records that will be hyperlinked to pages that will show more detail. This is an advanced topic that is discussed in a later tutorial: Passing Parameters.

In most cases, the default options are preferable, although you may or may not want the table to have visible borders. You DO usually want labels on the column rows AND you usually also want the table to automatically extend to the width of the page.

Click the down arrow on the formatting options to see some of the other potential formats:

Select "List - one field per item". You will see the options change and the screen will appear like the following:

This versatile format brings with it many options. You can select whether or not you want labels beside each field, and whether you want a horizontal line separating the various records.

Also in this format style, you can decide on one of many List Options. Why not experiment with some of these options to see how the data will appear.

Now check out the third formatting option, "Drop-down List - one record per item".

This is another popular choice. This creates a drop-down list of database values. You can choose to have it display one field value while submitting another. This can be handy when you want to display a product name, but actually submit the ProductID to a second page. The following drop-down list of suppliers was populated from the Suppliers table of the Northwind Database.

Now, go back to the first option in the formatting options, "Table - one record per row" and click Next to bring you to Step 5, the final step in the process:

This final step lets you do several things. You can choose to display all of your records in one long list, OR have it group them into smaller, faster loading pages. This option will add a button that will allow you to navigate between the various groups of records.

Also on this page, you can choose to add a search form that will allow users to type in values and search the database. This option will be grayed out if it is not available to you. We'll discuss numerous search techniques in a later tutorial.

Click finish and you'll see the database results wizard added to your page. It will look like the following:

Had you selected the option to Split the records into groups of 5, you would see a slightly different DRW:

Now, here is what the actual DRW section will look like when you view it live:

ProductID ProductName
5 55
17 Alice Mutton
40 Boston Crab Meat
60 Camembert Pierrot
18 Carnarvon Tigers
[1/16]

Like magic, you are now viewing actual database records from the Northwind sample database. Subsequent tutorials will help you build upon these basic skills to do some amazing things. All it takes is a little FrontPage Magic!

If you want to make changes to your DRW page, simply right click anywhere within the DRW and select "Database Results Properties". This will open the Database Results Wizard and allow you to make any changes you want.

Now that you have gone through this tutorial, do it again - and again - and again. Try every option possible to see how the various choices affect the end result. Become an expert at using the DRW BEFORE you move on to more challenging tutorials. You need to master these fundamentals in order to understand the more complex lessons that await you.


These tutorials are part of an upcoming training course called "FrontPage Magic - How To Create A Database Driven Website For Non-Programmers". Stay tuned for more details on this exciting new product.

Send your tips to .
All materials Copyright © Ward Cameron All Rights Reserved