HOW TO: Query Two Tables in the Same Database in FrontPage 2003 (825443)
The information in this article applies to:
- Microsoft Office FrontPage 2003
For a Microsoft FrontPage 2002 version of this
article, see
318281. SUMMARYThis article describes a method that you can use to query
and retrieve information from two tables in a database in FrontPage 2003. The
example that is described in this article uses Microsoft SQL statements to
search for data in the Categories and Products tables in the sample Northwind
database that match a submitted value for a column that is used in both
tables. back to the topHow to Create a Query to Retrieve Information from Two Tables in a Database To create a search page and a results page to search for and find
specific values from two tables in a database, follow these steps:
- Create two new pages that are named Search.asp and
Results.asp. To do so, follow these:
- Start FrontPage (if it is not already
started).
- On the File menu, point to
New, and then in the New task pane, click
Blank page.
- On the File menu, click
Save.
- Specify a location where you want to save the file,
type Search.asp in the File name box,
and then click Save.
- On the File menu, point to
New, and then in the New task pane, click
Blank page.
- On the File menu, click
Save.
- Specify a location where you want to save the file,
type Results.asp in the File name box,
and then click Save.
- Create and configure the form on the search page. To do so,
follow these steps:
- In the Folder List, double-click
Search.asp to open the page.
- On the Insert menu, point to
Form, and then click Textbox.
- On the page, right-click the text box that you
inserted, and then click Form Field Properties.
- In the Name box, type
ID, and then click OK.
- On the page, right-click the text box, and then click
Form Properties.
- Under Where to store results, click
Send to other, and then click Custom ISAPI, NSAPI,
CGI, or ASP Script.
- Click Options.
- In the Action box, type
results.asp, and then click
OK.
- Click Results.asp, click
OK, click OK, and then click
OK.
- On the File menu, click
Save.
- Configure the database query on the results page. To do so,
follow these steps:
- In the Folder List, double-click
Results.asp to open the page.
- On the Insert menu, point to
Database, and then click Results.
- Click Use a sample database connection
(Northwind), and then click Next.
- Click Custom query, and then click
Edit.
- Either type or copy and paste the following line to the
SQL Statement box:
Select * From Categories,Products Where Categories.CategoryID=::ID:: and Categories.CategoryID=Products.CategoryID Note This SQL statement returns all the columns from the Categories
table and the Products table where the ID that is sent from the Search.asp page
matches the CategoryID in the Categories table and the Category ID in the
Categories table matches the CategoryID in the Products table. - Click OK.
- Click Next three times.
- Click Display all records together,
click to clear the Add search form check box, and then click
Finish.
- On the File menu, click
Save.
- In the Folder List, double-click
Search.asp to open the page.
- On the File menu, click Preview in
Browser, and then click the Web browser that you want to
use.
- In the text box, type 3, and then
click Submit.
The columns from the Categories table
and the Products table that contain a CategoryID value of 3 are
returned. back to the
topREFERENCESFor more information about the Database Results Wizard in
FrontPage 2003, see FrontPage Help. To do so, on the Help menu, click
Microsoft Office FrontPage Help. In the Search
for box, type database results, and then press
ENTER to view the topics that are returned. For more information
about FrontPage, visit the following Microsoft Web site: Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. back to the
top
Modification Type: | Minor | Last Reviewed: | 1/6/2006 |
---|
Keywords: | kbdownload kbhowto KB825443 kbAudEndUser kbAudITPRO |
---|
|
|
©2004 Microsoft Corporation. All rights reserved.
|
|