Subject RE: [IBO] Retrieve ID of last record posted
Author Jason Wharton
Did you set the BufferSynchroFlags property to include bsfAfterInsert? 
That should bring the new value from the server back to the client.
If not, you might consider making use of the GeneratorLinks property.
Then, the value would be acquired and assigned on the client.
 
Jason


From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]
Sent: Tuesday, August 28, 2018 3:45 PM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] Retrieve ID of last record posted

 

This ID field is an "AutoIncrement" field, done by a Generator. After I do:

MyQuery.Post;

If I just do:

id := MyQuery.FieldByName(...).AsInteger;

...it always retrieves 0.

Best regards.

On Tue, Aug 28, 2018 at 6:41 PM 'Jason Wharton' supportlist@... [IBObjects] <IBObjects@yahoogroups.com> wrote:
 

Why wouldn't you just be able to access its value using a TField object or FieldByName()?

How and when is the new value assigned?
Jason Wharton

 

From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]
Sent: Tuesday, August 28, 2018 3:34 PM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] Retrieve ID of last record posted

Sorry. It's IBOQuery. My fault.

On Tue, Aug 28, 2018 at 5:22 PM 'Jason Wharton' jason@... [IBObjects] <IBObjects@yahoogroups.com> wrote:
 

You mentioned you are using TIBQuery, but that is a component from IBX and not IBO.
 
Please clarify which component from IBO you are using in the case that this was just a typo.
 
Thanks,
Jason Wharton
 


From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]
Sent: Tuesday, August 28, 2018 2:19 PM
To: IBObjects@yahoogroups.com
Subject: [IBO] Retrieve ID of last record posted

 

Hello!

After doing a Post on a Live TIBQuery, is there a way to Retrieve the ID of that posted record?

Regards.

Mauro.



--

==================================================
Mauro Nacif Rocha
Departamento de Informática
Universidade Federal de Viçosa - MG - Brasil
mnacif@...    http://www.dpi.ufv.br/~nacif/
tel.: (31) 3899-1775 / 3891-5133 / 99965-0323
==================================================



--

==================================================
Mauro Nacif Rocha
Departamento de Informática
Universidade Federal de Viçosa - MG - Brasil
mnacif@...    http://www.dpi.ufv.br/~nacif/
tel.: (31) 3899-1775 / 3891-5133 / 99965-0323
==================================================