Import

Setting Up Your Database Connection Using ADO

This page assumes that you have imported an Access database into your web and that you will be using FrontPage 2000 to manage the web.  Before your pages can communicate with the database you must set up a connection , in much the same way that you must set up a connection (by dialing) if you want to communicate with a friend by telephone. One way to establish a connection is to use an ActiveX Database Object (ADO) using Visual Basic Scripting Edition (VBScript).

This page assumes that you have imported an Access database that contains information about the employees of an imaginary company called Volcano Coffee Corporation. It is assumed that the database is called "volcano2000.mdb" and has been placed in the folder called '_private'. It is also assumed that the database contains a single table called 'Employees' which has the following fields: FirstName, LastName, Title, City, State, Email, Phone.

To set up your database connection using ADO, follow these steps:

  1. On the Tools menu, click Web Settings, and then click the Database tab.
  2. Click Add.
  3. In the New Database Connection dialog box, type "Volcano2" (without the quotation marks) in the Name box. Click to select the File or folder in current Web option.



    Click Browse.
  4. In the Database Files In Current Web dialog box, navigate to the files folder of your web. Click to select volcano2000.mdb, and click OK.

  5. In the New Database Connection dialog box, click OK.
  6. In the Web Settings dialog box, click Verify.

    After the question mark changes to a check mark, click OK.
  7. In the Web Settings dialog box, click OK.

Use a Form to Post Information to a Database

Previous versions of FrontPage required custom ASP script to post information to a database. FrontPage 2000 has expanded its support for database management. To post information to a database using an HTML form, follow these steps:

  1. On the File menu, point to New, and click Page.
  2. On the Insert menu, point to Form, and click Form.




    This will add Submit and Reset buttons surrounded by the form, represented by a dashed-line bounding box.
  3. With the insertion point in front of the Submit button, type "First Name: " (without the quotation marks). On the Insert menu, point to Form, and click One-Line Text Box.



    Right-click the text box, and click Form Field Properties. In the Name box, type "FirstName" (without the quotation marks), and click OK. Select the text and the text box.

    On the Insert menu, point to Form, and click Label

    Press ENTER to move the insertion point down two lines.
  4. Repeat step 3 until your form looks similar to the following:

First Name:     Email Address:

Last Name:     Phone Number:

Title:

City: State:  

Use the following names for the form fields:

LastName, Title, City, State, Email, Phone.

  1. Right-click anywhere within the form, and click Form Properties.
  2. In the Form Properties dialog box, click the Send to database button, and click Options.

  3. In the Options for Saving Results to Database dialog box, click to select Volcano2 in the Database Connection to Use list, and then click the Saved Fields tab.

  4. Click to select City in the Form Field column, and click Modify.

  5. In the Modify Field dialog box, click OK.
  6. Repeat steps 8 and 9 for each item in the Form Field column until your Saved Fields tab looks similar to the following:

  7. Click OK.
  8. On the File menu, click Save As. Save the page as "post.asp" (without the quotation marks).

Now that you have learned how to set up a connection to an imported database and how to use a form to add new records to the database, you can learn how to modify and delete records by clicking HERE.