|Subject||Re: Interbase Transactions|
--- In email@example.com, Helen Borrie <helebor@w...> wrote:
> OK, now that I understand we are talking about Delphi and IBX, we
> getting somewhere.
> Yes, it is true that if you are depending on the trigger to
> key column, then you won't see the new ID column until the
> If you want to see it BEFORE the transactions commits, you must
> from the generator before you post the insert. You will need a way
> this and there are several. With IB Objects you can do it
> using the GeneratorLinks property of the dataset.
> This is how I do it for non-IB Objects applications:
> Declare this function:
> function GetGeneratorValue(GeneratorName: String;): integer;
> Q: TIBQuery;
> Q := TIBQuery.Create(nil);
> with Q do
> DatabaseName := TheDatabase; // check these property names,
> might be slightly different from BDE
> Transaction := TheTransaction; // ditto
> SQL.Add('Select GenID(' + GeneratorName + ',1) from
> Result := Fields.Value;
> Then, in your BeforeInsert event, include this call:
> Table1.FieldByName('IDField').AsInteger :=
> Check those property names of TIBDatabase and TIBQuery for IBX - I
> I no longer have IBX installed on my system.
> Others use a stored procedure that does the same. IB Objects and
> have methods and properties that make it unnecessary.
> All for Open and Open for All
> InterBase Developer Initiative · http://www.interbase2000.org