Dreamweaver

Add logic to delete the record (ASP, JSP)

After adding a button the user can click to delete the record, the final step is to add the Delete Record server behavior to update the database table after the user clicks the Submit button.

  1. In the Server Behaviors panel (Window > Server Behaviors), click the Plus (+) button and select Delete Record from the pop-up menu.
  2. In the Connection pop-up menu, select a connection to the database.

    Click the Define button if you need to define a connection.

  3. In the Delete from Table pop-up menu, select the database table that contains the record to delete.
  4. In the Select Record From pop-up menu, specify the recordset that contains the record to delete.
  5. In the Unique Key Column pop-up menu, select a key column (usually the record ID column) to identify the record in the database table.

    If the value is a number, select the Numeric option. A key column usually accepts only numeric values, but sometimes it accepts text values

  6. In the Delete By Submitting pop-up menu, specify the HTML form with the Submit button that sends the delete command to the server.
  7. In the After Deleting, Go To box, enter the page to open after the record is deleted from the database table or click the Browse button to browse to the file.

Dreamweaver adds a server behavior to the page that lets users delete records in a database table by clicking the Submit button on the form.