close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Only update records that have changed - possible?

Thread began 3/07/2010 3:19 am by webmaster364567 | Last modified 3/09/2010 7:56 pm by Eric Mittman | 647 views | 1 replies |

webmaster364567

Only update records that have changed - possible?

Hi.
I am trying to only update records that have changed and not update the records that haven't changed. Is this possible?

The case is like this:

I have a list of questions for pupils - a1, a2. a3. ..... a28, a29.

They are able to access the page whenever they want to and they can choose witch questions they want to answer. They are able to answer the question with four answers - w1, w2, w3 or w4. But when they anser I want todays date to be stored in the same recordset with the answers and only on the questions that they change the answer on.

a1 - w2 - 03.03.2010

a2 - w2 - 03.03.2010

a3 - w3 : new value w1 - 07.03.2010

a4 - w3 - 03.03.2010

a8 - w1: new value w3 - 07.03.2010

I want only to update the questions where there is a new value in the answers and then automaticly store the date of today in these questions.

Is this possible with the multiple update function in DataAssist? I am thinking of using the onChange function with the questions answers (dynamic list) and then store the ids of the questions in an array to run the multiple update with. (Sorce: article11.asp)

Sign in to reply to this post

Eric Mittman

How you will do this will depend on how you have this information stored in the db. If you have each answer that the user gives as a unique record in the db then it might be a little simpler to implement.

From what I can tell you will need to have some custom parts for this. The first part would be creating a recordset. You can then populate the form elements with the values from this recordset to show the answers that have already been stored.

Next you would have the user make the updates that they need and submit the form. You would need to loop over the posted values and compare them to the values in your original recordset. If the value does not match the original value then you will update the record. When you update the value with the posted value you can also update the time field with the current time.

This is a custom thing but I think this is the best approach. This way you can make use of a single update server behavior and update only the records that have changed. If you tried to do this with a multiple update server behavior all of the records would be updated regardless of weather or not the value changed. You will need to manually check the value against the existing value to ensure that it has changed.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...