================================================================================
//               ZEOS Library Bug Reporting / Bug Fixing Form                 //
================================================================================

Bug ID               : 1213274                      Priority      : 5
Submitted by         : adi3000                      Date Submitted: 2005-06-02 07:30
Quality assurance by : stefanglienke                Closed as of  : 2005-06-03 07:16
Assigned to          : stefanglienke                Closed by     : stefanglienke

--------------------------------------------------------------------------------

Server (and Version) : n/a
ZEOSLib Version      : 6.5.1 alpha
Component/Class      : n/a

--------------------------------------------------------------------------------

Error Description:

I discovered a strange behavior: 
1) I have an empty dataset. I try to post a record and in 
BeforePost event I check OldValue variable. Normally in 
this point the value is NULL but instead I get List out of 
bounds (-1) error. I repeat, this happened only if the 
data set is empty and I try to insert a new record. 
2) Dataset is not empty. I try to insert another record 
and in my case I need to check OldValue in BeforePost 
event (this because this event is used in case of a new 
record or to post modification to an existing record).Ok, 
if I check OldValue, only at insert, I get the value from 
the record that exist already in the dataset. This is not 
normal, normal must be NULL because this record is 
not already posted, is new. If I post a modification to an 
existing record, in OldValue I get a correct value.

--------------------------------------------------------------------------------

Actions done form Bugfixing:

You should Check whether the .State is dsEdit when you check the OldValue 
variable because for dsInsert it make no sense to check the OldValue.
This Value is only valid when the DataSet is in Edit-Mode.

================================================================================


