![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 6 of 6 total |
![]() |
Tue, Nov 7 2006 6:16 AM | Permanent Link |
"Jose Eduardo Helminsky" | Hi everyone
I´ve changed my THProTable (inherited from TDBISamTable) to create a new method called Modified. I want to use it to alert the users when they change some values from current record and apply cancel button. This method is simple but works like expected except from one thing: When the state of table is dsBrowse and I call this method the value of the "OldValue" property is always NULL. It is by design or this is a bug in DB.PAS ? My code: function THProTable.Modified: Boolean; var nI: Integer; begin Result := False; for nI := 0 to Fields.Count-1 do begin if Fields[nI].OldValue <> Fields[nI].Value then begin Result := True; break; end; end; end; IMO when the state of a dataset is dsBrowse then the OldValue should be the same as Value. Or am I wrong ? Eduardo |
Tue, Nov 7 2006 8:17 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Jose
My guess is its by design - if the table is in dsBrowse mode then any changes have been committed therefore there is no old value. It makes sense unless you expect the database to keep a record of all the changes. Roy Lambert |
Tue, Nov 7 2006 9:00 AM | Permanent Link |
"Jose Eduardo Helminsky" | Roy
I understand your point but at least for me the OldValue and Value in this state of the dataset should be the same instead of OldValue = null. I can live with this behavior but... Thanks for your comment Eduardo |
Tue, Nov 7 2006 9:03 AM | Permanent Link |
"David Farrell-Garcia" | Jose Eduardo Helminsky wrote:
> IMO when the state of a dataset is dsBrowse then the OldValue should > be the same as Value. Or am I wrong ? > > Eduardo Think of the oldvalue as a delta. It only contains a value if the field is modifed, otherwise it is null. Once committed, it is null once again. You would be better coding it as: if oldvalue <> null then .... When using oldvalues or deltas you should always check for null values. -- David Farrell-Garcia Whidbey Island Software, LLC |
Tue, Nov 7 2006 9:04 AM | Permanent Link |
"David Farrell-Garcia" | Jose Eduardo Helminsky wrote:
> Roy > > I understand your point but at least for me the OldValue and Value in > this state of the dataset should be the same instead of OldValue = > null. > > I can live with this behavior but... > > Thanks for your comment > > Eduardo That is pretty much the way it is anywhere. ClientDataSets are the same. You must check OldValue before updates are actually committed. -- David Farrell-Garcia Whidbey Island Software, LLC |
Tue, Nov 7 2006 5:10 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Eduardo,
<< It is by design or this is a bug in DB.PAS ? >> By design. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Wednesday, August 14, 2024 at 07:31 PM | Privacy Policy![]() © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |