Digital Workshop http://forum.digitalworkshop.co.uk/ |
|
Databases - Part 4: Modifying Existing Records in a Database http://forum.digitalworkshop.co.uk/viewtopic.php?f=13&t=9 |
Page 1 of 1 |
Author: | Robin Garrett [ October 25th, 2004, 3:43 pm ] |
Post subject: | Databases - Part 4: Modifying Existing Records in a Database |
Q: One of the contacts in my database has recently changed jobs, so I need to modify the OCCUPATION for this person's record. How can I modify an existing record in my database? A: To do this, you first need to search for the relevant entry in the database, so that the record which needs to be modified is the current record. You can then use the Update Current Record action to modify the existing values. The following procedure should assist you in this: 1) Open the tutorial publication into Opus Pro 2) Add a text input box to the page 3) In the properties of the text input box, select the Text Input tab 4) Select the NAME variable from the drop-down list of variables 5) Click Apply and OK 6) Now repeat steps 2-5 to create two more text input boxes, assigning the first to the existing AGE variable and the second to the existing OCCUPATION variable 7) Add a button object to the page 8) In the actions for the button, select the Database group of actions 9) Double-click on the Update Current Record action 10) Open the drop-down menu for the DSN field and select the DSN you created in Part 1 11) Open the drop-down menu for the Table field and select 'Table1' from the list provided 12) You should now see all of the fields from the database appear in the grid below the DSN and Table fields 13) Click on the NAME field to highlight it 14) Enable the Variable radio button 15) Now open the drop-down menu for the Variable field and select the NAME variable 16) Click on the AGE field to highlight it 17) Enable the Variable radio button 18) Now open the drop-down menu for the Variable field and select the AGE variable 19) Click on the OCCUPATION field to highlight it 20) Enable the Variable radio button OCCUPATION variable 22) Click Apply and OK to confirm the changes 23) Preview the publication 24) Type a search string into the search input field and click the button to display the matching record 25) You should notice that the matching record also appears in the three text input boxes we have just added 26) Click inside the text input box which is displaying the OCCUPATION variable and edit its contents to the new occupation of your contact 27) Click the button to update the current record To confirm that the record has been updated, simply exit out of the publication, then go back into preview mode and search for the original surname - no records will be returned. However, if you search for the new surname, a matching record should be displayed with the original NAME and AGE information. |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |