Subject RE: [IBO] bookmark problem after insert
Author IBO Support List
I have worked on this issue and I have reached a resolution of a few things.
First of all, it isn't correct that you get a different behavior between Insert and Append.
I found out the reason for this and I have made a correction to this problem.
When doing an Append the bookmark had a different flag value than when being inserted.
I'm not exactly sure why this is so just yet, but I have improved things to be consistent here at least.
When you do an insert or an append and you haven't done anything to actually alter the record, when a call to CheckBrowseMode is made the Insert/Append is actually cancelled.
So, in the call to GotoBookmark there is a call to CheckBrowseMode that causes the Insert/Append to become cancelled.
Therefore, there isn't a record anymore that can be located because the bookmark pertained to the now cancelled record.
The reason Append seems to work is because when getting a bookmark from an appended record it was actually returning a blank bookmark. And, when calling GotoBookmark with a blank bookmark nothing is done.
It is actually appropriate to get an error message under the circumstances of the sample app you provided for me.
However, I realize your actual application likely has more complex needs.
So, we are probably going to need to work together some more to deliver the perfect solution you are looking for.
I am going to commit some changes to my development repository on this soon and then you can update and test with them and we can decide from there what is the most appropraite next step.
Please let me know when you are ready to test my changes so we can take this additional step.
Jason Wharton

From: []
Sent: Wednesday, July 29, 2015 9:56 AM
Subject: RE: [IBO] bookmark problem after insert

Hi Jason,

I send you a little application : [i've spent more time to understand how to upload the file than write the program.... yahoo hates 7Z :-) ]

I use :
- employee.fdb,
- 1 x TIBODatabase
- 1 x TIBOQuery
- 1 x TDataSource

The main source code is :
    procedure TForm1.Button1Click(Sender: TObject);
        IBODatabase1.DatabaseName := ExtractFilePath(ParamStr(0)) + '\..\..\' + 'EMPLOYEE.FDB';
        IBODatabase1.Connected := true;
        IBOQuery1.Active := true;

    procedure TForm1.Button2Click(Sender: TObject);

    procedure TForm1.Button3Click(Sender: TObject);
        _bk         : TBookmark;
        _bk := IBOQuery1.GetBookmark;


The exception occurs in the GotoBookmark.

My temporary solution used is to replace the Insert by an Append....

kind regards,