This is the code when a new item is added, the table has a primary key on ID (bigint).
Code: Select all
with tabupdate do begin
close;
tablename := 'doc';
filter := 'id=0';
keyFields := 'ID';
filtered := true;
// The next statement takes ages
open;
insert;
docid := dmod.NextID('DOC');
FieldByName('ID').AsString := docid;
...
I used "component to code" from gExperts to supply the following code, containnint the current settings. And I use autocommit on the connection object.
Code: Select all
with tabUpdate do
begin
Name := 'tabUpdate';
Connection := DB;
FetchRows := 1;
LockMode := lmNone;
SpecificOptions.Clear;
SpecificOptions.Add('InterBase.DeferredBlobRead=True');
SpecificOptions.Add('InterBase.CacheArrays=False');
SpecificOptions.Add('InterBase.CacheBlobs=False');
end;