Updating records in a databaseYou can create forms that display a single record or more than one record. To create a form showing more than one record, you can, for example, place form fields in a table row, bind them to fields of a content source, and turn on Replace Rows for the table so that the table is filled with values from different records, one record going into the fields in each table row. GoLive keeps track of which record is associated with each field on the form so form Update actions can send data from the form to the appropriate record even if more than one record is shown in the table. When an Update action is performed, all data from the form is written to the database, updating whichever records and fields are present on the form. This includes hidden fields that are bound to the content source. Form fields that are not bound to the content source and other page elements that are bound do not participate in the database update action. After the update action is performed, the next page displayed can be either the current page, a different page selected if the update operation is successful, or a different page selected if the update operation fails. To set up a form for a database update:
You can have more than one submit button on the form, each with a different action. Be very careful of how fields not present in the form are handled in the database. If a field is not on the form, it must have allow zero length, not required, or default values specified. Otherwise, difficult-to-diagnose errors may result because the database will reject the update. Make sure you have set up proper database permissions for the Web server to make updates or for the identity specified in data source. Remember that when your action is being processed on the server, the Web server's identity is used to validate file access. The Web server's identity is also used to validate database access unless there is another identity specified as part of the data source. |