Do they want to 'store' a copy of the original, and be able to revert?
Or do they just want to know 'x made changes on this date.' Or do they
want to know 'x changed this field from old value to new value' on x date.
How many changes do they want to store?
You could create a text field of some sort, and just continue
appending values to it everytime someone makes a field. Functional,
but not very elegant. If they wanted to revert changes, they would
have to do it manually, by looking at the list of changes.
If you were feeling really adventurous, you could add an 'active'
field, a username field, and a previousversionID field.
Don't ever update a record, just create new ones. Set the old
record to 'inactive' using the active field, so it no longer shows up
in your queries. In the new record insert the current user's name,
and the ID of the record they were changing. (Use 0 or Null for the
initial records). You can do a loop on a query to get a list of
changes.
Functional, but it doesn't seem very elegant.
You could also add a third table just to keep track of changes.
Something like:
changeID, columnname, initial value, new value, date, userID
So, you could bring up all the changes that user X performed on the
database. And in a pinch you could probably write code to revert
changes, too.
Enough brainstorming, I think I like the last idea best. Does
this help?
Jeff Fongemie wrote:
>
> I have a client that needs a real simple app. A form that lets a user modify
> records in a database. Easy. Except, they want to have a record of which
> user made what changes! How in the heck is this possible? Is it?
>
> We would have a table of users, and they would log in first. There would be
> less than 30 users to keep track of. I can imagine keeping track of when
> they log in, but how to track what changes are made?
>
> Do I look into a CF or Database function??
>
> Any help on this would be great.
>
> Jeff Fongemie
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Structure your ColdFusion code with Fusebox. Get the official book at
>http://www.fusionauthority.com/bkinfo.cfm
>
> Archives: http://www.mail-archive.com/[email protected]/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
--
Jeff Houser
mailto:[EMAIL PROTECTED]
AIM: Reboog711 | ICQ: 5246969 | Phone: 860-229-2781
--
Author of Instant Cold Fusion 4.5
ISBN: 0-07-213238-8
Due out 3rd Quarter 2001
--
DotComIt, LLC
Computer Consultant specializing in database driven web data
ColdFusion, Lotus Notes/Domino
--
Half of the Alternative Folk Acoustic Duo called Far Cry Fly
http://www.farcryfly.com
http://www.mp3.com/FarCryFly
--
Does Everyone Think I'm a Cynical?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists