I have a Formview with a large number of fields, the update statement updates all the fields in the form.
Is it possible to dynamicaly generate code that only updates fields whos values have changed?
It's a lot easier to update everything then to pick and choose. You'd have to loop through every control and compare it to it's old value. Which means you'd have to make a way to look at the old value to do the comparison. Then you'd dynamically create a SQL update statement from all that afterwards, if you went through all the trouble of doing that.
There is no reason to check what has changed. As tperry pointed out, it is a lot of unnecessary coding. An update statment that includes 1000 columns or 1 column will have the same inpact on the database.
Thanks for the reply, at the moment I have a form with over 100 fields from an AccessDataSource which I display in several collapsible <divs>. When Irun the update command
I recieve a "Query is too complex" error (Access has some limitatiions in the size of a query) which is why I wanted to create a shorter update command, but I understand it's best to create several smaller forms.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.