Subject RE: [IBO] Strange behaviour with blobs and InsertSQL
Author Jason Wharton
There is a partial fix for this that should help:

In IB_Components.pas around line 33,340 I modified two procedures as
follows:

procedure TIB_BDataset.SysEditCursorRow;
begin
inherited SysEditCursorRow;
if not CachedUpdates then
begin
if ( bsAfterEdit in BufferSynchroFlags ) or
(( Fields.FTempBlobIDCount > 0 ) and ( KeyLinksExist )) then
if not SysScrollCurrent( true, false, false ) then
SysAdjustCurrentRow( true, true );
//! Cancel;
//! raise EIB_DatasetError.Create( 'Edited record was lost' );
end;
end;

procedure TIB_BDataset.SysInsertCursorRow;
begin
inherited SysInsertCursorRow;
if not CachedUpdates then
begin
if ( bsAfterInsert in BufferSynchroFlags ) or
(( Fields.FTempBlobIDCount > 0 ) and ( KeyLinksExist )) or
( not PreparedInserts and ( InsertSQL.Count = 0 ) and
FUpdateSQL.NeedRecordResync ) then
if not SysScrollCurrent( true, false, false ) then
SysCancelInsertedRow;
//! Cancel;
//! raise EIB_DatasetError.Create( 'Inserted record was lost' );
end;
end;

I added a check for KeyLinksExist so that it wouldn't attempt to do a
re-fetch unless necessary.

Though, I highly recommend you make use of KeyLinks so that it can function
as it should.

Jason Wharton


-----Original Message-----
From: Daniel Albuschat [mailto:daniel@...]
Sent: Tuesday, August 17, 2004 11:39 PM
To: IBObjects@yahoogroups.com
Subject: [IBO] Strange behaviour with blobs and InsertSQL



Hello,

I've noticed a very strange (and broken) behaviour when
using TIB_Query's InsertSQL property.
I've put together a test-case that should reproduce
the problem (with version 4.2.I at least):
[snip]