Subject | RE: [IBO] bookmark problem after insert |
---|---|
Author | IBO Support List |
Post date | 2015-07-30T21:45:50Z |
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.
Thanks,
Jason Wharton
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]
Sent: Wednesday, July 29, 2015 9:56 AM
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] bookmark problem after insert
I send you a little application : pb_ibo_1.zip [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);
begin
IBODatabase1.DatabaseName := ExtractFilePath(ParamStr(0)) + '\..\..\' + 'EMPLOYEE.FDB';
IBODatabase1.Connected := true;
IBOQuery1.Active := true;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
IBOQuery1.Insert;
end;
procedure TForm1.Button3Click(Sender: TObject);
var
_bk : TBookmark;
begin
_bk := IBOQuery1.GetBookmark;
IBOQuery1.GotoBookmark(_bk);
IBOQuery1.FreeBookmark(_bk);
end;
*****************************
The exception occurs in the GotoBookmark.
My temporary solution used is to replace the Insert by an Append....
kind regards,
Laurent GILBERT
SPIRALE INGENIERIE