Friday, October 9, 2009

Ultradev example tutorial: 3.5 compiles the record in the database

The 3rd chapter: Applied database founds dynamic webpage

The 5th: Compile the record in the database

Should edit or delete a record, above all we should know what we are editing or deleting is that record. The word of confuse one thing with another is not the result that we want:) When the database is being told to design in front, special mention, a watch should have advocate the uniqueness that bolts ability determines a record quite, just won't cause delete editorial perhaps mistake. Want to seek a person that calls Zhang San e.g. us, but the person that at the same time ten call Zhang San exists, such you should look for we are about to decide which Zhang Sancai according to particular feature. Advocate key also is such, advocate key is OK by one stature paragraph composition, OK also by a few stature paragraph composition. To us this Userinfo watch is told, advocate key is the automatic number field that the name is ID, this ID val ue is exclusive, we should know that is to say only an ID can find a record exclusively, such, it is OK that our editor deletes an operation on the rails.

Good, chattered so long, the trip that begins us.

The page that that data that lets us open us to begin to do shows comes, add many unit division, make editor and the connection that delete respectively, if pursue.

Editorial join is: Edit.asp? > of Id= < %=(Recordset1.Fields.Item("ID").Value)%

The join that delete is: Del.asp? > of Id= < %(Recordset1.Fields.Item("ID").Value)%

You should ask, what meaning do this express? , make me fine fine line comes.

Edit.asp? > of Id= < %=(Recordset1.Fields.Item("ID").Value)%

The meeting after expressing to click this join opens a page that is Edit.asp, deliver to this page the name is Id, the value is< %=(Recordset1.Fie lds.Item("ID").Value)% >parameter, next the parameter that in Edit.asp this page can deliver the past according to this will take out corresponding record to undertake handling.

Friends saw, < %=(Recordset1.Fields.Item("ID").Value)% >The value that is the ID field in our Data Bindings actually. Each notes correspondence has an unique ID value only, namely this< %=(Recordset1.Fields.Item("ID").Value)% >, can take out this record when Edit.asp obtains this value, as to how to take, let us look downward. Was opposite, also be to do such processing to the join that delete.



Build one page, save for Edit.asp, next we resemble above of the introduction in that way, begin to found record volume, but this record volume founds a process to have a few different, if plan institute shows:



Filter was not used when we found record volume previously. Just as its name implies, it is the condition with certain basis will filter certain the data that we do not need. What list inside Filter is the field that your database expresses, we choose here, it is conditional setting " = " next, then we fall draw the choice circle below ID, choose URL Parameter, fill on ID.

Why to choose this? Our join form is not above:

Edit.asp? Id=<%=(Recordset1.Fields.Item("ID").Value)%> Class="coffee">

, see dot clue came, edit.asp? Id= . . . . This Id is URL Parameter, take along with you, want us to be filled here only to coming. After installing these, express, our cost that records collect to choose ID field only is equal to us to pass the cost of the Id in the past. Of course, because we passed a cost only, so, the record that takes will have only.


How be after is record volume taken, revised? Actually, be equivalent to reinserting namely data.


Open menu Insert ->Live Objects -> ;Record Update Form


Oh! Follow that Record Insert Form very resemble, different place is only much an Unique Key Column (field of only key word) , chattered a long time above us namely advocate key, the choice is ID field, next the thing is simple, be in according to us add what the record acquires in the section, revise you till satisfaction. Defulat Value need not be in charge of it, final result is like plan institute to show.





Good, we nephew hits a lantern - unaltered, open a browser to examine our achievement, choose us to just add the record of enterprising: Dd has an edition, if plan institute is shown.





After clicking Update Record pushbutton, jump turn to indication page, if plan institute is shown, our data had been changed, ah, happy!



OK, view this data after editing process, believing to delete an operation to come to you will not be a tickler any more, below one we will explain how to undertake those who occupy counting delete. You are OK also and relaxed---After all this certain place that compiles a record is more incomprehensible still:)

No comments:

Post a Comment