Dreamweaver MX Ultradev Exploration (5-1)

Source: Internet
Author: User
Tags final key dreamweaver
Dreamweaver Dreamweaver MX Ultradev Exploration (5) Deleting records in a database

Continue our Dreamweaver MX Tour, in the previous chapter we learned how to use the DW MX server behavior to update the database records, you should also remember it. Its powerful server behavior allows us to manipulate databases in a database without having to write a single line of code, such as inserts, updates, deletes, and so on, mentioned earlier. In this chapter, we will learn to delete records in a database using DW mx.

Let's talk about its basic concepts first. : The Web application may contain pages that allow users to delete database records through the browser, usually by displaying the records to be deleted on the page, and then deleting unnecessary records through the user's actions on the database. A Delete record (delete records) server behavior is brought in the DW MX to manipulate the deletion of the database. In fact, and the previous chapter we learn the update database operation is much the same, first by browsing the data, select the data to be deleted, and then the corresponding delete page, confirm the deletion. The concrete steps are not detailed here, please see the previous one.

   <1>Preparation, in the previous chapter we described how to jump to the relevant database record field using the Jump to Detail page connection (go to Detail page) server behavior. This is no exception here, and the final display effect is shown in figures (5-1) and (5-2).



5-1



5-2

The details of the above are not detailed here, please see the fourth chapter. :)

   <2>Well, the preliminary work is ready, and this time our protagonist is the server behavior of the delete record (delete records). Its function is also very simple, see the name to know it is specifically used to delete the recordset. OK, set up our subpages, receive the values from the first page, and display the corresponding database records. These are also mentioned in the fourth chapter, and the final display effect is shown in figures (5-3) and (5-4). Remember to put the form in the form and name the text box inside it.



5-3



5-4
   <3>A detailed description of the delete record (Deletes records). The Application-->server Behaviors-->delete record, as shown in figure (5-5).



5-5

Click the dialog box shown in figure (5-6). It's not hard to find that it's very similar to the server behavior of updating the database content that we talked about in the previous chapter.

Connection:You can select the database connection to use from this Drop-down list, and if not, you can click Define to redefine a database connection.

Delete from Table:In this Drop-down list, you can select which table in the database you want to delete.

Select record from:Select the recordset name you want to use here.

Unique Key Column:Select the key field for the table where you want to delete the recordset, and if the key field content is a number, select the right numeric check box, which is usually the default for us here.

Delete by submitting:In this Drop-down list, select the name of the form that submitted the delete operation. Because we have a single form on the page that is not named, it automatically selects Form1, and if you make changes to the table single-name or have more than one form, select the appropriate form.

After deleting, go to:When you complete this deletion, jump to which page, where we enter delok.asp. (Don't forget to build this page!) )



5-6

When this is done, the page appears as shown in figure (5-7), where the server behavior is applied to different colors.



5-7
   <4>Final Test!

Let's take a look at the records in the database, as shown in figure (5-8).



5-8

Sample effect Diagram (5-9) for the main page.



5-9

Here we choose to delete the first record, click on the deletion of the record with ID 1, then jump to the deleted sub page, show the effect as shown in figure (5-10).



5-10

The submission will jump to the delok.asp page we just defined, and then look at the records in the database, as shown in figure (5-11).



5-11

Oh... You should also see that the records have been deleted.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.