DreamweaverMX Ultradev Exploration (3-1)
Author:Eve Cole
Update Time:2009-05-31 21:07:43
Dreamweaver MX Ultradev exploration (3) Add records to the database
Okay, let's continue from the previous chapter. The previous chapter talked about dynamically displaying database content. I believe everyone is very excited now, haha. . . Have you been thinking for a long time that you should be able to manually add data on the web page? Of course no problem, DW MX has prepared everything for us. Generally speaking, to add records to the database through ASP pages, you need to provide an interface for users to enter data, which can be achieved by creating a form and page. Using Dreamweaver MX's Insert Record (insert record set) server behavior, you can add records to the database.
Without further ado, create a new page, as shown in Figure (3-1)
3-1 Everyone should know it.
<1> After clicking, you will find that the page that appears is very different from the previous DW or UD, as shown in Figure (3-2). DW MX is very convenient in creating different dynamic web pages. You can choose the type you want at will, instead of having to choose the saving type like before. Here we choose to create a dynamic page (Dynamic Page) and select VBScript as the scripting language of the page. OK, save as insert.asp.
3-2
<2> We use ACCESS to create a new database and save it as "User Table", as shown in Figure (3-3). Specify ID as the primary key and set its data type to be automatically numbered.
3-3
Did you notice that I used Chinese for the field type here? In the UD era, Chinese would never have appeared, but in the DW MX era, we can finally use it. I am so touched... as shown in Chapter 2 Introduction, establish the system DSN, and establish a database connection in DW MX, as shown in Figure (3-4).
3-4
<3> OK, the preparations are finally completed here. As mentioned earlier, to add records to the database through the ASP page, we need to provide an interface for users to input data, that is, we need to create a form on the page and provide an area for users to input, so that we can save the data submitted by the user into the database. Design the following interface, as shown in Figure (3-5).
3-5
Notice the red numbers above? Don't worry, there is one more thing to note here, as shown in Figure (3-6). To specify the names of these text boxes, I designated the first "user name" and the text box after it as "user name". The other two are the same, designated as "password" and "email" respectively. Just pay attention to the password. The type (Type) of an item should be specified as Password, so that when the user enters the password, they will see only a series of * signs. Note: In the past, Chinese could not be used to name text boxes in UD, but now it can also be used in DW MX.
3-6