Subject RE: [IBO] Exception "Record was not located to update"
Author Jason Wharton

I believe I know what the problem is.  I have another customer who recently tested the newer version of IBO, after I significantly reworked the UpdateMode mechanisms in version 5.9.1 IIRC.

What we discovered is when UpdateMode is set to umAllWhereAll a WHERE clause is generated with input parameters checking for the old column values but it does not work correctly when it is NULL.  I changed this UpdateMode to generate a new SQL statement with each update performed using the IS NULL clause when necessary.  This uses the EXECUTE IMMEDIATE mechanism so it will still be sufficiently efficient requiring only a single API call instead of doing a handle allocation, prepare, describe, bind and execute combination.

I have already fixed this issue and I have a patch you are welcome to try to see if it solves the problem you are facing.

 

Kind regards,

Jason Wharton

www.ibobjects.com

 

 


From: IBObjects@yahoogroups.com [mailto: IBObjects@yahoogroups.com ]
Sent: Friday, August 25, 2017 3:09 AM
To: IBObjects@yahoogroups.com
Subject: [IBO] Exception "Record was not located to update"

 




Hi Guys,

 

I have a problem with TIBOTable on record update. 

 

CachedUpdates is enabled.

 

"ApplyUpdates" generates the exception "Record was not located to update".

 

Has anyone run into the same problem and knows how to solve it ?

 

More infos :

 

1) I recompiled my old application with DELPHI 10.2 and IBO 5.9.5.2652.

2) Previous version was build with DELPHI SEATTLE and IBO 5.7.7.2340 ; and all is working.

 

My general code to save the changes is :

 

            procedure ibValiderModifications(ADataSet : TIBODataSet); 

            var 

                         _Pos : TBookMark; 

            begin 

//                      if state in [dsInsert, dsEdit, dsSetKey] then

//                                  CheckBrowseMode;

 

            _Pos := GetBookmark;

        try

                           if Modified and CanModify then

                                       Post;

 

                        ApplyUpdates;

 

                           if BookmarkValid(_Pos) and (not IsEmpty) then

                                       GotoBookmark(_Pos);

        finally

                           FreeBookmark(_Pos);

        end;

 

I put the "checkbrowsemode" in comment to see... but the exception is still present...

 

This code works when it is called with a TIBOQUERY.

 

Thanks.