• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 13. Adding Database Connections > Creating Database Connections

Creating Database Connections

It’s a subtle but crucial distinction: a database connection is not the same as a database. Instead the connection acts as a view, or portal, from a Web page to the information within the database. By using FrontPage to create and configure that connection, you can control exactly which pieces of the database your Web visitors see and use. As you follow the steps detailed in the rest of the chapter, remember that you’re making a connection with a database, not creating the database itself.

To create a database connection

1.
Make sure you know the pathname or URL for the database you want to use, whether it’s already part of your Web site or on a remote server.

2.
Open an existing Web page and click where you want the database to appear. You also can create a new page by choosing File > New > Page or Web and then using the Task pane to open a blank page.

3.
Once the page appears, choose Insert > Database > Results (Figure 13.6).

Figure 13.6. To create a database connection in your Web page, choose Insert > Database > Results.


4.
When the first screen of the Database Results Wizard appears (Figure 13.7), choose the connection you want to use: a sample connection with one of FrontPage’s example databases, an existing connection, or a new connection. For more information on creating a new connection, see page 325.

Figure 13.7. Use the first screen of the Database Results Wizard to choose a database connection.


5.
Once you’ve made your choice, click Next and, after a moment, the second screen of the Database Results Wizard appears (Figure 13.8). Decide whether you want to select a Record source using the existing fields listed in the drop-down list or create a Custom query. (Custom queries use SQL statement syntax, which falls beyond the scope of this book.) If you choose Record source, use the drop-down menu to select the set of records you want to use (Figure 13.9).

Figure 13.8. Use the second screen of the Database Results Wizard to select a Record source using an existing field or by creating a Custom query.


Figure 13.9. If you choose Record source, use the drop-down menu to select the set of records you want to use.


6.
Once you’ve made your choices, click Next and the third screen of the Database Results Wizard appears (Figure 13.10). By default, all of the record source’s fields will be listed for display. If you want to exclude some fields, click Edit List.

Figure 13.10. Use the third screen of the Database Results Wizard to edit which fields will appear. The More Options button lets you filter and sort the results.


7.
When the Displayed Fields dialog box appears, use the Remove button to narrow the Displayed fields to only those you want users to see (Figure 13.11). The removed fields will be listed in the Available fields column. Use the Move Up and Move Down buttons to rearrange the order in which the fields will be displayed on your Web page. Click OK when you’re done and you’ll return to the wizard’s third screen (Figure 13.10). If you want to sort or filter the fields more precisely, click More Options. For details, see Filtering and sorting options.

Figure 13.11. The Displayed Fields dialog box lets you add, remove, or rearrange the database fields shown.


8.
Once you’ve made your choices, click Next and the fourth screen of the Database Results Wizard appears (Figure 13.12). Use the first formatting drop-down menu to choose whether to display the results as a table, list, or drop-down list. Depending on your choice, the dialog box will offer additional choices for formatting the results (Figures 13.13 and 13.14). Use the check boxes and drop-down menus to refine the appearance of the records and click Next.

Figure 13.12. Use the drop-down menu in the Database Results Wizard’s fourth screen to format how the results are displayed.


Figure 13.13. If you choose a list format, use the checkboxes and List options drop-down menu to fine-tune how the results are displayed.


Figure 13.14. If you choose a drop-down menu format, use the dialog box’s drop-down menus to fine-tune how the results are displayed.


9.
When the fifth screen of the Database Results Wizard appears (Figure 13.15), choose whether to Display all records together or Split records into groups. If you decide to split them, enter a number into the records per group text box.

Figure 13.15. Use the fifth screen of the Database Results Wizard to decide whether to split the results into smaller groups.


10.
Click Finish and you’ll be returned to your page where placeholders for the database results (marked by << >>) will be displayed (Figure 13.16). The yellow areas mark the beginning and end of the database results and the explanatory text will not appear when the page is posted to the Web.

Figure 13.16. Once you’ve finished using the Database Results Wizard, FrontPage returns you to the now-formatted page.


11.
Save the page and when the Save As dialog box appears, FrontPage will have automatically given the file an .asp file suffix (Figure 13.17). ASP (Active Server Pages) files contain scripts linked to the server where the database resides. Click Save and the page will be saved as a database region.

Figure 13.17. When you save a page containing a database connection, FrontPage automatically assigns it an .asp suffix.


12.
Click the Preview in Browser button in FrontPage’s Standard toolbar (Figure 13.18), to get a more accurate sense of how the results will look to site visitors (Figure 13.19). To modify the results, see To change a database connection.

Figure 13.18. To see how the database connection will appear, click the Preview in Browser button in the Standard toolbar.


Figure 13.19. The database connection as it appears from within a Web browser.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint