Subject R: [IBO] Unique Key, Bookmark and refresh
Author Enrico Raviglione
Hi,
try with TIBOQuery->GeneratorsLink, this property can solve your problem
without lines of code.

Regards,
Enrico Raviglione.



-----Messaggio originale-----
Da: Gerhardus Geldenhuis [mailto:flooder@...]
Inviato: mercoledi 13 marzo 2002 9.16
A: IBObjects@yahoogroups.com
Oggetto: [IBO] Unique Key, Bookmark and refresh


Hi
I have a trigger that generates a unique primary key for my table. I set the
required property of the field to not required so that ibo does not moan
when I want to post the record. My problem is that I want to display the
value of this key to the user immediatly after creation. Refresh works fine
but it causes the cursor position to change. Bookmarking this record also
does not work because when going to the bookmark after refreshing I get the
following error: Record not found. I have also tried InvalidateBookmark but
this also does not have the desired effect.

Here is the piece of code, I have tried it in various orders to get it
working.
IBOQPOS_QISC.InvalidateBookmark(S);
S:=IBOQPOS_QISC.Bookmark;
IBOQPOS_QISC.Refresh;
IBOQPOS_QISC.Bookmark:=S;

How do I get the new value of the primary key without loosing the cursor
position? Would it be better to have a storedprocedure create the table
entry and return the primarykey value and then doing a refresh and locate?

Im using TIBOQuery.

Groete
Gerhardus



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

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/