FP2000: How to Update Information in a Microsoft Access Database Using FrontPage 2000 and ASP

ID: Q240090


The information in this article applies to:
  • Microsoft FrontPage 2000


SUMMARY

This article describes how to update information in a Microsoft Access database using FrontPage 2000 and Active Server Pages (ASP).


MORE INFORMATION

Getting Ready to Use the ASP Features in FrontPage 2000

Before you can use the ASP features in FrontPage 2000, you must install the following components:
  • A 32-bit ODBC driver


  • An ASP-compatible server such as one of the following servers:
    • Microsoft Internet Information Server (IIS) version 3.0 or Microsoft Internet Information Server (IIS) version 4.0 for Microsoft Windows NT Server


    • Microsoft Peer Web Services for Microsoft Windows NT Workstation with the ASP engine added


    • Microsoft Personal Web Server for Microsoft Windows 95 with the ASP engine added


    • Microsoft Personal Web Server 4.0




  • FrontPage 2000 Server Extensions


NOTE: Microsoft Personal Web Server version 4.x, Internet Information Server 4.x, and Microsoft Peer Web Services for Microsoft Windows NT Workstation include the ASP engine and thus do not require a separate installation of the ASP engine. Versions earlier than Microsoft Personal Web Server 4.x and Internet Information Server 4.x require that the ASP engine be installed.

Section 1: Create a Web and a Database to Contain the Information
  1. In FrontPage 2000, on the File menu, create a new web by pointing to New and then clicking Web.


  2. In the Specify the location of the new web box, type the following:
    http://localhost/aspsample
    Use the One Page Web Wizard.


  3. Open a new page. Create four one-line text boxes by doing the following:
    1. On the Insert menu, point to Form and then click One-Line Text Box.


    2. If your pointer is not already there, place it between the one-line text box and the Submit button by using the arrow keys.


    3. Press ENTER twice. Use the DOWN ARROW key to move the pointer below the text box.


    4. Add three more one-line text boxes by repeating step a.




  4. Insert the following information for the form fields 1 through 3:
    1. Double-click the first one-line text box. The Text Box Properties dialog box appears. In the Name box, type FirstName.


    2. Double-click the second one-line text box, and type LastName in the Name box.


    3. Double-click the third one-line text box, and type Phone in the Name box.


    4. Double-click the fourth one-line text box, and type Email in the Name box.




  5. Type the name of the form field just to the left of each one-line text box. Save the page as ASPsample.asp.


  6. Right-click in the form, and select Form Properties. In the Form Properties dialog box, click Send to database, and then click Options.


  7. In the Options for Saving Results to Database dialog box, do the following:
    1. Click Create Database.


    2. Click OK twice to get back to the page, and then save the page.




NOTE: Add some records to the database by previewing the page in the browser. When the page opens in the browser, add three different records by filling out the form and clicking Submit after each record you create.

Section 2: Create the Update Page

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals 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 needs. If you have limited programming experience, you may want to contact a Microsoft Certified Solution Provider or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Solution Providers, please see the following page on the World Wide Web:

http://www.microsoft.com/mcsp/
For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp
  1. Switch to FrontPage 2000 and create a new page. (On the File menu, point to New, click Page, and click Normal Page.)


  2. On the new page, on the Insert menu, point to Database, and click Results. In Step 1, click Use an existing database connection and select ASPsample. Click Next.


  3. In Step 2, click Custom query and then click Edit. In the SQL statement window, type the following SQL code:
    
    UPDATE results
    SET Phone='%%Phone%%',Email='%%Email%%'
    WHERE FirstName='%%FirstName%%' and LastName='%%LastName%%' 
    Click OK and then click Next.


  4. In Step 3, click Next.


  5. In Step 4, click Next.


  6. In Step 5, make sure Add Search Form is unavailable (dimmed) or is not selected. Click Finish and then save the page as Update.asp.


NOTE: The field names FirstName, LastName, Phone, and Email represent the fields used in the Aspsamp.mdb file. The fields %%FirstName%%, %%LastName%%, %%Phone%%, and %%Email%% represent the one-line text box form fields.

Section 3: Create the Update Form
  1. On a new page, on the Insert menu, point to Database, and click Results.


  2. In Step 1, click Use an existing database connection and select ASPsample. Click Next.


  3. In Step 2, click Results as the Record Source, and then click Next.


  4. In Step 3, click Edit and remove all fields except FirstName, LastName, Phone, and Email. Click OK and then click Next.


  5. In Step 4, select List - one field per item in the Formatting list and Text fields in the List options list, and then click Next.


  6. In Step 5, select Split records into groups, and enter 1 in the records per group box. Click Finish.


  7. Double-click Submit and change the Value/Label field to Update.


  8. Right-click inside the form and go to Form Properties.


  9. In the Form Properties dialog box, select Send to other, and then click Options.


  10. In the Action field, type Update.asp. Click OK twice and save the page as Update_Form.asp.


NOTE: You can make changes only to the Phone and Email fields. You cannot make changes to the FirstName and LastName fields, because they would not equal what is in the database. To update FirstName or LastName, you must create your own custom SQL statement.


REFERENCES

For additional information about this issue, click the article number below to view the article in the Microsoft Knowledge Base:

Q246570 FP2000: Error Message: 'Database Results Error Description ... Data Type Mismatch in Criteria Expression'

Additional query words: front page

Keywords : kbdta
Version : WINDOWS:
Platform : WINDOWS
Issue type : kbinfo


Last Reviewed: January 10, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.