Sunset at Oak Island, North Carolina

Spider Web Woman Designs

Microsoft FrontPage® Database Results Wizard (DBRW) - Tips, Tricks and Tutorials

Tutorials

How to create a Database Connection in a FrontPage Web

Working with Today's Date in the Microsoft FrontPage® Database Results Wizard

How to search for a value between two other values

Alternate Row Colors in ASP Query Results

How to create a pick list and generate a detail page

How to create a "Pick List" page with a dropdown list and generate a detail page

How to filter a database query using two drop down lists

SQL (the language, not the server) Resources

All about Connection Strings

 

How to prevent DBRW from returning results before searching

Make a copy of your page and remove the results region from the first.asp. Set the form properties of both pages to POST to the second.asp. In Normal View, right-click on the form, select Form Properties, Send to other: Custom ISAPI, NSAPI, CGI, or ASP Script. Click on Options, and set the Action to: second.asp. Click OK twice. You have now set the form in first.asp to post to second.asp when the user hits the Submit button.  If you do not want to open a new browser window, add Target="_self" like this: 

<form BOTID="0" METHOD="POST" ACTION="second.asp" Target="_self">

So, when you first access the search page (first.asp) you do not run the DBRW through a search. You enter what you want, click button and DBRW starts on second.asp. New searches can be performed at second.asp too.

Courtesy of: William Lee

How to dynamically generate the Title tag on the Results page from the database query

Open the Results page in FrontPage, switch to HTML/Code view, and near the top of the page, add a line before the Head tag, and modify the Title tag as follows:

		<% strTitle = Request("tutorialID")%>
		<head>
		<title>Tutorial: <%=strTitle%></title>

where "tutorialID" is the name of your search field.

How to change the Database Results Wizard buttons to text

Look in the _fpclass folder for the file called fbdbrgn1.inc  If you don't see the _fpclass folder, go to Tools | Web Settings | Advanced | Options - the checkbox for 'Show documents in hidden directories' needs to be checked. Open the fpdbgrn1.inc file in a text editor.

Here's an example:

fp_sFirstLabel = "First 5 Records "
fp_sPrevLabel = "Previous 5 Records "
fp_sNextLabel = "Next 5 Records "
fp_sLastLabel = "Last 5 Records "
fp_sDashLabel = " -- "

How to change the color, font, etc. of the DBRW buttons

Look in the _fpclass folder for the file called fbdbrgn2.inc  If you don't see the _fpclass folder, go to Tools | Web Settings | Advanced | Options - the checkbox for 'Show documents in hidden directories' needs to be checked. Open the fpdbrgn2.inc file in a text editor, find where the buttons are written - here's the first one:

and Style it like this:

How to change a text search box to a drop down?

If you go back to the Normal View of the Form, the following will change the form field from a text box to a drop down and then you can look at the code in HTML view and see the format:

Right click on the form field and select Form Field Properties.

Copy the field name, then cancel.

With the field still selected, use Insert | Form | Drop Down Menu to replace the text field.

Then right-click and select Form Field Properties.

Paste the form field name into the name field and add your selections.

Courtesy of: Mark Rogers.

How to place a "The Search Results for your keyword are:" message at the top of your page

Add this code to your page, where articleText is the field name you were searching on.

The results of your search for <%=Request("articleText")%> are:

Clickable email address in the Database Results Wizard?

FP2000: In Normal view, right-click on the field, select Hyperlink, choose Parameters, delete http:// from the Path box and type mailto: in its place. Choose Insert Field Value, and select the fieldname containing the e-mail address from the dropdown list.

FP2002: In Normal view, right-click on the field, select Hyperlink, choose Link to: Email Address, Parameters, Choose Insert Field Value, and select the fieldname containing the e-mail address from the dropdown list and click OK and OK again.

FP2003: In Design view, right-click on the field, select Hyperlink, choose Link to: Email Address, Parameters, Choose Insert Field Value, and select the fieldname containing the e-mail address from the dropdown list and click OK and OK again.

Clickable Hyperlinks in Database?

FP2003: In Design View, right-click on the field, choose Database Column Value Properties, check Display as Hyperlink and click OK.

FP2002 and FP2000: In Normal View, right-click on the field, select Hyperlink | Parameters

Click in the Path box (where you see  http:// ), the Insert Field value button is now available to use.

Click on it and all the fieldnames in your database will drop down from that button.

Choose the field with the URL in it and this code will appear in the box:

http://<%=FP_FieldLink(fp_rs,"URL")%>

Click OK twice, save the page, and Preview in Browser.

If you have some records where the URL field is empty, you will see a line in the Database Results when you preview the page. If you want to get rid of it, find in your code where the URL field gets displayed, and change it to this:

<% If fp_rs("URL")> " " then %>
<a href="<%=FP_FieldLink(fp_rs,"URL")%>">
<% End If %>

Also, the URL field in your database needs to be a full URL, i.e. http://www, not www

How to make the hyperlinks open in a new window

First, remove all the gray code from the area that displays the field, and then add the target tag, so it looks like this - the trick is to surround the _blank with single quotes, not double.

<p><b>Web Site:</b>&nbsp;<%="<a target='_blank' href=""" & FP_FieldLink(fp_rs,"website") & """>" & FP_FieldVal(fp_rs,"website") & "</a>"%></p>

How to format a Database field as Currency?

In your SQL, you could do this:

Format(myAmount,'$#,##0.00') as Dollarfield

Dollarfield will show up on your page.

How to total the columns created by the DBRW?

In your SQL, you could do this:

SELECT SUM(myAmount) AS MySum

MySum will show up on your page.

How to total the columns AND format that total as Currency?

In your SQL, you could do this:

SELECT Format(Sum([myAmount]),'Currency') AS MySum

MySum will show up on your page.

How to format a Database field as a Percent?

In your SQL, you could do this:

Format(myPercent,'##0.00##%') as newPercent

newPercent will show up on your page.

How to format a Database field as a Telephone Number?

In your SQL, you could do this:

FORMAT(WorkPhone,'(###) ###-####') as newPhone

newPhone will show up on your page.

How to count the total number of records in your database?

In your SQL, you could do this:

SELECT COUNT(*) FROM YourTable

Formatting Dates and Times in the Microsoft FrontPage® Database Results Wizard

Dates and times in your database can be reformatted using the Custom Query option in the Database Results Wizard - here are some examples:

SELECT format(YourDate,'mm/dd/yyyy') gives you: 01/02/2004

SELECT format(YourDate,'mmm dd, yyyy') gives you: Jan 02, 2004

SELECT format(YourDate,'mmmm dd, yyyy') gives you: January 02, 2004

SELECT format(YourDate,'mmmm d, yyyy') gives you: January 2, 2004

SELECT format(YourDate,'ddd mmmm d, yyyy') gives you: Fri January 2, 2004

SELECT format(YourDate,'dddd mmmm d, yyyy') gives you: Friday January 2, 2004

MSDN Resources (scroll down to the Remarks section):

ms:format-date Function

ms:format-time Function

 



Email UsWe're on Google+LinkedIn ProfileFollow us on TwitterLike Us on Facebook!