This article describes how to display the contents of an existing database using Active
Server Pages (ASP).
Before you can use the ASP features in FrontPage 98, you must install the following
components:
- Start Microsoft Access 97 and do the following:
a. Create a database that includes
one table. Name the table "Employees"
(without the quotation marks).
b. Insert four fields and name them:
EmployeesID
FirstName
LastName
EmailName
c. Save the table and switch to Design view.
d. Enter one record into the table using your first name, last name and
e-mail name.
e. On the File menu, click Save. In the File Name box, type
"Aspsamp.mdb" (without the quotation marks) and click Save.
- Start FrontPage Explorer and create a new Web by following these steps:
a. On the
File menu, point to New, and click FrontPage Web.
b. In Step 1, click One Page Web.
c. In Step 2, click Change.
d. In the "Please specify a location of the New FrontPage Web" box, type
the following:
http://localhost/ASPWeb
e. In the "Choose a title for your FrontPage Web" box, type "ASPWeb"
(without the quotation marks).
f. Click OK twice.
- On the View menu, click Folders.
- Import the Microsoft Access 97 database file into FrontPage Explorer, by following these
steps:
a. On the File menu, click Import.
b. Click Add file.
c. Click Browse, select the file you created in step 1, and then click
Open.
d. Click OK.
- Create an executable folder by following these steps:
a. On the File Menu, point to
New, and click Folder.
b. Name the folder "ASP" (without the quotation marks).
c. Press ENTER.
d. Right-click the ASP folder and click Properties on the menu that
appears.
e. Click to select the "Allow scripts or programs to be run" check box.
f. Click OK.
- Create a system Data Source Name (DSN), by following these steps:
a. On the Windows
Start menu, point to Settings, and then click Control
Panel.
b. Double-click the 32bit ODBC icon (Windows 95) or the ODBC icon
(Windows NT).
c. Click the System DSN tab.
d. Click Add.
e. Select the driver you want to use. For example, select "Microsoft
Access Driver (*.mdb)." Click Finish.
f. In the Data Source Name box, type the name you want. For example,
type "Aspdemo." Note that the DSN name should not include any spaces.
g. Click Select.
h. Select the database file you want to use (for example, select
Aspsamp.mdb). The file will be located in one of the following
IIS Web server locations:
- Personal Web Server for Windows 95:
C:\Webshare\Wwwroot\Aspweb\Aspsamp.mdb
- Internet Information Server for Windows NT Server:
C:\InetPub\Wwwroot\Aspweb\Aspsamp.mdb
- Microsoft Peer Web Services for Windows NT Workstation:
C:\InetPub\Wwwroot\Aspweb\Aspsamp.mdb
i. Click OK three times.
- On the Tools menu, click Show FrontPage Editor.
- On the Insert menu, point to Database, and click Database Region Wizard.
- In the Database Region Wizard, do the following:
a. In the "ODBC Data Source
Name (DSN)" box, type "Aspdemo" (without
the quotation marks). Click Next.
b. In the "Enter the SQL string for the query" box, type the following
SQL code:
SELECT * from Employees
Click Next.
c. Click Add Field.
d. In the Add Field dialog box, type "EmployeesID" (without the
quotation marks). Click OK.
e. Repeat steps c and d for each of the remaining fields (FirstName,
LastName, and EmailName) that you created in step 1.
f. Click Finish.
g. Click OK.
- On the File menu, click Save. In the Save As dialog box, select the
ASP folder you created in step 5. In the File Name box, type
"display.asp" (without the quotation marks) and click Save.
- Open the page in your Web browser.
For more information about Active Server Pages in FrontPage 98, please see the
following articles in the Microsoft Knowledge Base: