Re: SQL Update question
- From: "Robert Morley" <rmorley@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 10 May 2007 22:28:52 -0400
That's one reason for a Dirty property, but mostly it's so you know
whether to prompt the user to save data that hasn't been saved yet when
they close the form. To "dump the change and go back" requires that you
store the original value somehow.
Actually, on an Access form, you can simply undo the control's/form's update
(ControlName.Undo or Form.Undo, IIRC) and it'll revert to the old value(s)
providing it's bound (which is pretty much the norm for Access)...I don't
*think* it works for unbound controls/forms.
Generally, if ONE thing needs updated, you just update everything, even if
the values are the same. It's just easier this way because you've only got
one UPDATE SQL statement.
This only applies if you're using UPDATE statements. If you're using a
rs!Field.Value = MyValue, then the one-update thing isn't really an issue,
as DAO or ADO will figure out what's appropriate. In this case, it would
probably be more desirable to not update if the field hasn't changed.
Two reasons NOT to update everything are 1) if there's some kind of
replication going on (particularly column-level replication) in the
database, in which case updating a field, even if it's to the same value,
may trigger unnecessary replication of the data and potentially cause
conflicts; and 2) if you're using a database that supports triggers,
updating a field unnecessarily may cause the trigger to fire. This may be
undesirable if, say, you're tracking the time a specific field last changed
and the field hasn't actually changed.
Rob
.
- Follow-Ups:
- Re: SQL Update question
- From: Steve Gerrard
- Re: SQL Update question
- References:
- SQL Update question
- From: Darhl Thomason
- Re: SQL Update question
- From: MikeD
- SQL Update question
- Prev by Date: Re: Exiting from a Do Loop
- Next by Date: Re: Problems with MciSendString
- Previous by thread: Re: SQL Update question
- Next by thread: Re: SQL Update question
- Index(es):
Relevant Pages
|