Microsoft KB Archive/175771

= FP98: How to Display Contents of a Database Using ASP =

Article ID: 175771

Article Last Modified on 1/22/2007

-

APPLIES TO


 * Microsoft FrontPage 98 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q175771



SUMMARY
This article describes how to display the contents of an existing database using Active Server Pages (ASP).



Getting Ready to Use the ASP Features in FrontPage 98
Before you can use the ASP features in FrontPage 98, you must install the following components:


 * An ASP engine on the IIS derivative Web server.

NOTE: If you are running Microsoft Internet Information Server (IIS) version 4.0 or later, or the Personal Web Server (PWS) version 4.0, do not install Asp.exe. Doing so will break the ASP engine that comes pre-installed with those products.

- The ASP engine (Asp.exe) is located on the FrontPage 98 compact disc in the following folder

:\60 Minute Intranet Kit\60 Minute Intranet Kit\modules

where  is the drive letter of the compact disc.
 * One of the following servers:
 * Microsoft Internet Information Server (IIS) 2.0/3.0/4.0 for Microsoft Windows NT Server.
 * Microsoft Internet Information Server (IIS) 5.0 for Microsoft Windows 2000 Server or Professional.
 * Microsoft Peer Web Services for Microsoft Windows NT Workstation
 * Microsoft Personal Web Server for Microsoft Windows 95/98.
 * FrontPage 98 Server Extensions.
 * A 32-bit ODBC driver.

Displaying the Contents of a Database using ASP
To display the contents of a database by using ASP, follow these steps:

 Start Microsoft Access 97 and do the following:  Create a database that includes one table. Name the table "Employees" (without the quotation marks).  Insert four fields and name them: EmployeesID FirstName LastName EmailName  Save the table and switch to Design view. Enter one record into the table using your first name, last name and e-mail name. On the File menu, click Save. In the File Name box, type "Aspsamp.mdb" (without the quotation marks) and click Save.</li></ol> </li> Start FrontPage Explorer and create a new Web by following these steps: <ol style="list-style-type: lower-alpha;"> On the File menu, point to New, and click FrontPage Web.</li> In Step 1, click One Page Web.</li> In Step 2, click Change.</li>  In the "Please specify a location of the New FrontPage Web" box, type the following: http://localhost/ASPWeb </li> In the "Choose a title for your FrontPage Web" box, type "ASPWeb" (without the quotation marks).</li> Click OK twice.</li></ol> </li> On the View menu, click Folders.</li> Import the Microsoft Access 97 database file into FrontPage Explorer. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> On the File menu, click Import.</li> Click Add file.</li> Click Browse, select the file you created in step 1, and then click Open.</li> Click OK.</li></ol> </li> Create an executable folder by following these steps: <ol style="list-style-type: lower-alpha;"> On the File Menu, point to New, and click Folder.</li> <li>Name the folder "ASP" (without the quotation marks).</li> <li>Press ENTER.</li> <li>Right-click the ASP folder and click Properties on the menu that appears.</li> <li>Click to select the "Allow scripts or programs to be run" check box.</li> <li>Click OK.</li></ol> </li> <li>Create a system Data Source Name (DSN). To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>On the Windows Start menu, point to Settings, and then click Control Panel.</li> <li>Double-click the 32bit ODBC icon (Windows 95) or the ODBC icon (Windows NT).

In Windows 2000, double-click Administrative Tools, and then double-click click Data Sources (ODBC).</li> <li>Click the System DSN tab.</li> <li>Click Add.</li> <li>Select the driver you want to use. For example, select "Microsoft Access Driver (*.mdb)." Click Finish.</li> <li>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.</li> <li>Click Select.</li> <li>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/Windows 2000:

C:\InetPub\Wwwroot\Aspweb\Aspsamp.mdb

- Microsoft Peer Web Services for Windows NT Workstation:

C:\InetPub\Wwwroot\Aspweb\Aspsamp.mdb</li> <li>Click OK three times.</li></ol> </li> <li>On the Tools menu, click Show FrontPage Editor.</li> <li>On the Insert menu, point to Database, and click Database Region Wizard.</li> <li>In the Database Region Wizard, do the following: <ol style="list-style-type: lower-alpha;"> <li>In the "ODBC Data Source Name (DSN)" box, type "Aspdemo" (without the quotation marks). Click Next.</li> <li> In the "Enter the SQL string for the query" box, type the following SQL code: SELECT * from Employees Click Next. </li> <li>Click Add Field.</li> <li>In the Add Field dialog box, type "EmployeesID" (without the quotation marks). Click OK.</li> <li>Repeat steps c and d for each of the remaining fields (FirstName, LastName, and EmailName) that you created in step 1.</li> <li>Click Finish.</li> <li>Click OK.</li></ol> </li> <li>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.</li> <li>Open the page in your Web browser.</li></ol>

<div class="references_section">