Re: how to get both old and new value for a changed text box



Izzy,
The Access app I am porting from is in use at multiple businesses where
there is a mix of databases sizes; some use Access and some use SQL
Server as backend db (hence my need to accommodate both). My users
require saving unlimited field change history (w/ old & new values, who
made the change, date/time change made, field changed, etc), so the
history can get rather large. I would prefer to capture the changes at
the same time a record gets saved versus as each field changes for
synchronization purposes. Just curious, why do you recommend against
comparing against the cached (old) values? Also, does setting IsDirty
as you suggested prevent the automatic database update until you force
it? Another contributor suggested saving the old value in each
control's Tag property. That seems workable, too. Another contributor
suggested subclassing, but I would lose the control's visibility in the
designer which I really don't want to do.
Thanks for the help.
Kathy

Izzy wrote:
Kathy,

I had a nice long respone written for you....then my stupid computer
over heated and turned off.

Anyway...here's an idea:

If this data is being stored in Access, you could insert the old data
into the history table before you run your update. This will create a
little extra duty for your database server but a very common task for
audit tracking.

I would try to avoid comparing each textbox's value with a cached
initial value too determine if changes have been made. I usually just
define a boolean property called "IsDirty" and on validating of the
textbox controls set this property to true. You can then use that to
determine if an update and insert needs to take place.

If IsDirty Then

MoveToHistory(PrimaryKey)
UpdateTable(PrimaryKey)
IsDirty = False
Else

'No Changes Detected
End If

Just curious...How big is this Access database? AND how much history do
you need too store?

Izzy

.



Relevant Pages

  • Re: how to get both old and new value for a changed text box
    ... Also, does setting IsDirty ... history can get rather large. ... as you suggested prevent the automatic database update until you force ...
    (microsoft.public.dotnet.languages.vb)
  • Re: UDM and Star Schema
    ... For all I know SQLServer 2005 Analysis Service's proactive caching is good for direct connection with the relational database, and it does a good job in balancing performance with near real time data. ... historical partitions generally are stored in MOLAP mode, because you don't update them frequently. ... generally doing analysis against the history will not answer the same questions as the real time access. ...
    (microsoft.public.sqlserver.datawarehouse)
  • Re: 365 databases a year
    ... It is generally good to separate the two. ... history table as well with a current date of today... ... putting ALL of the history into a separate database from the current info ... I assume you mean storing a timestamp in every applicable ...
    (microsoft.public.sqlserver.server)
  • Re: Question about history
    ... I created 2 tables in a database: ChangeLog and ChageRows: ... IHistoryList - Interface used by History Client ... created a ToolStrip Control with Undo and Redo buttons on it. ... There are 2 History Lists, the Undo and the Redo History List, and ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Newbie question about db normalization theory: redundant keys OK?
    ... The question arises whether the database communicates any data other than ... relational databases, regardless of whether we use SQL as an interface, ... difference between history and state is just about identical between SQL ... Here is the problem with treating assignment as the only primitive ...
    (comp.databases.theory)