|
UltraDev 101
| ADMINISTRATION - Insert a record behavior (Adding new records) |
Here we will start the administration side of UltraDev. Of course with any database, you want to be able to add new records to it from on line. This is really simple with UltraDev.
Create a new page and call it "insertrecord.asp". First create an HTML form with all the fields that you want to submit to your database on it, and a submit button. Make sure to name your form fields according to what they mean! In this case I’d name them varfirst, varlast, varemail and varurl. "Var" standing for "variable". Here’s mine below:
|
Now that your form is done the way you want and everything is ready to go, open up Window > Data Bindings and use the + sign to create a new Recordset (Query) connection to your database like in the previous examples.
This time call the name: rsAddRecord, NO filter and NO sort. Use the same connection and table as in previous examples.
Now open up Window > Server Behaviors and use the + sign to select Insert Record from the menu. A new dialog window will appear.
Select the connection you want to use, and what table you want the records to be inserted into. Select which form all of your elements on the page lie. More than likely you just have one form, so let UltraDev default the form selection for you.
Now the fun part. This is sorta like mix and match. You have to match up the Form Element with the Column. So in this case we want "varfirst" on the form to match up with the "first" field inside the database. Under Form Elements you’ll see "varfirst ". Select it, and then in the columns drop down menu select "first".
Now if Form Elements it will read varfirst inserts into column "first" (Text). You’ll need to follow this process for every field that you want added into the database. Just be sure to match them up correctly.
|
And finally, at the bottom there is a "Go To URL" area. This is just a confirmation to look nice. You can either use one or not… it’s totally up to you. We’ll skip that in this exercise since it’s not vital to learning UltraDev.
Press OK and you are ready to test it out! Just add a new record and then you should see it get updated into your database. If you can’t tell right off you should be able to look at the total count of records and see that it raises to 15
|
|