Viewing a Database in a Browser

Using a database to collect information left by visitors is a safe and simple way to make your Web site more useful. Once information is entered in a database, you can either open the database in the application in which it was originally created, or you can use a Web page containing another script to view and edit the data. This topic provides a sample script you can use without editing to view the sample database provided with PWS. You can give visitors access to this script if you want them to be able to view the database. You can also customize the script to delete data in the sample database, or you can change the script to view other databases you have created.

To view the sample database in a browser

  1. Copy Viewdb.asp from your Windows\Help\Pws\Htm\Core directory to Windows\System\Inetsrv\Iisadmin\Website directory.
  2. Open your browser and connect to http://Localhost/Iisadmin/Website/Viewdb.asp.

    Tip   If you plan on viewing your database frequently, add this address to your Favorites list by using the Favorites feature of your Web browser. When you view the database, always refresh the page to be sure you are seeing the current data, and not a cached copy that is out of date.

    Important   The Website folder has special permissions that prevent access to any pages stored here, unless the access is made from the local computer. Remote visitors are not able to view the contents of the Website folder in their browsers.

To delete entries from the database by using a browser

  1. Copy Viewdb.asp from your Windows\Help\Pws\Htm\Core directory to Windows\System\Inetsrv\Iisadmin\Website directory.
  2. Open the file in a text editor, such as Notepad.
  3. Search for the text ‘Response.Write ““and remove the apostrophe at the beginning of the line.Search for the text ‘Response.Write ““and remove the apostrophe at the beginning of the line.Save the file in text-only format with the name viewdb.asp.

    Tip   To prevent Notepad from adding .txt to the file name, select All Files(*.*) as the Save as Type option.

    Open your browser and connect to http://Localhost/Iisadmin/Website/Viewdb.asp.To delete a row, click the Deletelink in the left column of the row.

    Caution   Deleting a row cannot be undone.

    To allow visitors to view or delete database entries

    1. Copy Viewdb.asp from your Windows\Help\Pws\Htm\Core directory to your home directory. (C:\Inetpub\Wwwroot is the default home directory used by setup).
    2. Search for the text ‘Database path statement for restricted viewing of the database. and place an apostrophe in front of the strProvider line directly below it.
    3. Search for the text ‘Database path statement to allow visitors to view the database. and remove the apostrophe in front of the strProvider line directly below it.
    4. If you want visitors to be able to delete entries in the database, make the modifications described in the earlier deleting entries procedure.
    5. Add a link to the Viewdb.asp page on your home page.

    Related Topics

    © 1997 by Microsoft Corporation. All rights reserved.

    Delete Record
    Delete

About Dewwa Socc