Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
 Discussion Forums
 HTML, XML, JavaScript...
 Software Reviews
 Editors,Others...
 Top100
 JavaScript Tutorials, ...
 Tutorials
 ASP, CSS, Databases...
 Discussion List
 FAQ, Roundup, Configure ...
 Authoring
 HTML, JavaScript, CSS...
 Design
 Layout, Navigation,...
 Graphics
 Tools, Colors, Images...
 Software
 Browsers, Editors, XML...
 Internet
 Domains, E-Commerce, ...
 WDVL Resources
  Intermdiate, Tutorials,...
 WDVL
 Discussion Lists, Top 100,...
 Technology Jobs


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Top 10 Articles
  1. Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
  2. JavaScript Tutorial for Programmers
  3. Design
  4. JavaScript Tutorial for Programmers - Objects
  5. JavaScript Tutorial for Programmers - JavaScript Grammar
  6. JavaScript Tutorial for Programmers - Versions of JavaScript
  7. Cascading Style Sheets
  8. JavaScript Tutorial for Programmers - Embedding JavaScript
  9. JavaScript Tutorial for Programmers - Functions
  10. Authoring JavaScript
Domain Name Lookup
Search to find the availability of a domain name. Just enter the complete domain name with extension (.com, .net, .edu)

Update Record (Cont.) - Page 20

August 21,2002

Just as for the Insert Record behavior, we have to create a form that reflects the database columns and table we want to update. But I've been having you do things the long way. Now that you know how to use the individual server behaviors, instead of creating the form we will use one of Dreamweaver MX's timesaving Objects – the Record Update Form.


Select Insert > Application Objects > Record Update Form, and you will be presented with the following dialog box:

As seen above, select the conn_webprodmx connection, books table to update, rsUpdateBook recordset, book_id as the unique key column and redirect to categories3.asp after updating.

Remove the following form fields from the list: book_image_path, category_id, and book_id (you should always remove unique IDs from the Update Record behavior because no one should ever be allowed to edit these values in normal circumstances. Also, we don't need to edit the image path through this form). Hit OK and the Update Record form should be created for you in your document.

Test your page in a browser, and try editing some of your book records.

We left the category_id out of the update to start off with, as explained above, but we might want to update this – that is, we might want to place a book into a different category. Let's do that now. We need to do three things: add the category_id column to the rsUpdateBook recordset, create a new recordset to retrieve the categories, add a field for the category ID in our update form, and add the category_id column to the Update Record behavior.

On the edit_book.asp page, get up the details for the rsUpdateBook recordset again, and add the category_id column to the SELECT SQL statement. Your SQL should now look like this:

SELECT book_id, book_author_fname, book_author_lname, book_isbn, book_price, book_title, page_count, category_id

FROM books

WHERE book_id = MMColParam


We also need to add a form field to the update form. Before we do that we should think about how we want to display the categories for display. The only thing stored in the book record that associates the book record with a particular category is the category_id. Most likely we will not have memorized the ID numbers of our categories – it would be more practical to retrieve the categories and select which category we want to place the book in from a listbox field. Thus we need to create a new recordset and retrieve the categories.

Create a new recordset called rsGetCategories. Make sure the conn_webprodmx connection is selected, and type the following SQL into the appropriate field:

SELECT category, category_id

FROM categories

ORDER BY category ASC

Hit OK. In your form, add a row above the seventh row that contains the Submit button (there should now be eight rows in all), and type the text "category" in the left column of this row. Now add a listbox field to the update form in the right column of this row (use Insert > Form Objects > List/Menu).

Update Record - Page 19
Dynamic Dreamweaver MX
Update Record (Cont.) - Page 21


Up to => Home / Authoring / DynamicDW




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers