Board index » delphi » Key modified...how to test?

Key modified...how to test?

  Is there a way to tell if the primary key in a (Paradox) table has been
changed?  I am tracking changes to a database, and need to know if a record
being posted has had its primary key changed.
  Do I need to read the primary key values into a variant array in
BeforePost and compare them against the same values in AfterPost, or is
there an easier way? Thanks...
-Howard Moon
 

Re:Key modified...how to test?


Are you able to check the OldValue variant of the dataset's field?  That
will get you a variant value of whatever the value was before you think it
might have changed.  The only problem is that you need to have your dataset
in CachedUpdate mode.

--
Michael Glatz
mgl...@caiso.com

Quote
Howard Moon wrote in message <76dc1u$r...@forums.borland.com>...
>  Is there a way to tell if the primary key in a (Paradox) table has been
>changed?  I am tracking changes to a database, and need to know if a record
>being posted has had its primary key changed.
>  Do I need to read the primary key values into a variant array in
>BeforePost and compare them against the same values in AfterPost, or is
>there an easier way? Thanks...
>-Howard Moon

Re:Key modified...how to test?


You need to save the values in AfterEdit, not BeforePost.  When BeforePost
is triggered the values have already been changed.

Bill

--
Bill Todd
(Sorry but TeamB cannot answer questions received via email)
(Remove nospam from my email address to contact me for any other reason)

Re:Key modified...how to test?


Quote
>  Do I need to read the primary key values into a variant array in
>BeforePost and compare them against the same values in AfterPost, or is
>there an easier way?

There isn't an easier way.  
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads