| View previous topic :: View next topic |
| Author |
Message |
Willy Verbiest Guest
|
Posted: Tue Dec 09, 2003 4:02 pm Post subject: How to get the previous value of a field |
|
|
Hi,
I want to know the previous value of a field of an already posted record.
I'm working with TADOQuery in Delphi 6.
Thanks in advance,
Willy Verbiest
|
|
| Back to top |
|
 |
baloonatic@hotmail.com Guest
|
Posted: Tue Dec 09, 2003 6:31 pm Post subject: Re: How to get the previous value of a field |
|
|
After the new value's been posted ?. You need to save it before you
post it then . the 'old / previous value properties in the data
objects are for processing before you post. If you want after, easiest
way is to add a previous value field to the table and write to it each
time you post.
|
|
| Back to top |
|
 |
Tomas Rutkauskas Guest
|
Posted: Wed Dec 10, 2003 11:05 am Post subject: Re: How to get the previous value of a field |
|
|
You can find it with SQL LAST.
Like
select LAST(myfields) from mytable;
But it will works with new inserted record only.
"Brian Bushay TeamB" <BBushay (AT) Nmpls (DOT) com> wrote
| Quote: |
I want to know the previous value of a field of an already posted record.
I'm working with TADOQuery in Delphi 6.
Ado doesn't keep that information after Post unless you setLockType to
ltBatchoptomistic.
--
Brian Bushay (TeamB)
[email]Bbushay (AT) NMPLS (DOT) com[/email]
|
|
|
| Back to top |
|
 |
Willy Verbiest Guest
|
Posted: Wed Dec 10, 2003 1:12 pm Post subject: Re: How to get the previous value of a field |
|
|
Hi Brian,
Thanks for the response, but I think I didn't explain it right.
If a user select an existing record and modify this then before he Post it I
want to know what the value was the value of a field before he did some
editing on it.
I want ot know NewZipcode versus OldZipcode to take an example.
I use normally the following function to get the value of a field:
ZipCode := qryCustomers.FieldByName('Zipcode').AsString;
But this gives me the current value from the buffer and not the previous
posted one.
I want to know the value that is in the record in the database.
Thanks in advance,
Willy Verbiest
"Brian Bushay TeamB" <BBushay (AT) Nmpls (DOT) com> wrote
| Quote: |
I want to know the previous value of a field of an already posted record.
I'm working with TADOQuery in Delphi 6.
Ado doesn't keep that information after Post unless you setLockType to
ltBatchoptomistic.
--
Brian Bushay (TeamB)
[email]Bbushay (AT) NMPLS (DOT) com[/email]
|
|
|
| Back to top |
|
 |
baloonatic@hotmail.com Guest
|
Posted: Wed Dec 10, 2003 7:02 pm Post subject: Re: How to get the previous value of a field |
|
|
There's a variant property of TField called oldvalue with the
originally retrieved data in it.
|
|
| Back to top |
|
 |
|