Subject Re: [IBO] Record was not located to update.
Author Omar Rosa
Thanks for all.
I solved this problem creating a function to bring the value generator and called it in onnewrecord table´s event.

Some like this:

function TFormPlanoa.IB_Generator ( Tbl : String ; inc : integer) : LongInt;
QueryAcerta.Sql.Add(format('select gen_id(%s,%d) val from rdb$database',[tbl,inc]));
result := QueryAcerta.FieldByName('val').AsInteger;
procedure TFormVisita.TableVisNewRecord(DataSet: TDataSet);
TableVis.FieldByName('pk_visitas').Value := FormPlanoa.IB_Generator ( 'g_visitas' , 1);

----- Original Message -----
From: Svein Erling Tysvær
Sent: Tuesday, November 13, 2001 9:40 AM
Subject: Re: [IBO] Record was not located to update.

Hi Omar!

>Have a trigger After post to assign an PK counter.

This is your problem (I assume you mean after insert). How is IBO supposed
to know what you do on the server? Basically, you tell IBO to insert a new
record - which it does, then you change its identifier ON THE SERVER
WITHOUT TELLING IBO, before asking IBO to change the record again. It's
like moving without telling anyone where you move and expect mail and
friends to find your new location.

To do what you want to do, you have to assign the PK at the client side.
IBO-wise this is normally done by using GeneratorLinks (I use the native
components and don't know how GeneratorLinks is used with the TDataset
components you seem to be using).


Yahoo! Groups Sponsor

IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________ - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]