Subject R: [IBO] Refresh Current Record in TIBOQuery
Author Enrico Raviglione
Hi,
do you have try the TIBOQuery property BufferSynchroFlags->bsAfterInsert
?

Regards,
Enrico.



-----Messaggio originale-----
Da: sugi [mailto:truesaint@...]
Inviato: domenica 14 settembre 2003 0.26
A: IBObjects@yahoogroups.com
Oggetto: [IBO] Refresh Current Record in TIBOQuery


Dear All,

In my TIBOQuery, I need to refresh the current (just inserted) record
because some triggers on the server side might change or override some
values. How do I do this ?

Btw, I found the following entry on the 'online FAQ' section : ... How
can I refresh a single record with TIBOQuery?

Call the InvalidateRowNum() method or the InvalidateBookmark() method to

do this. If I don't have it declared at the TIBODataset level you can
call it by referencing the InternalDataset property which gives you
direct access to the internal IB_Query instance that the TDataset layer
is on top of. You may need to call the TDataset.Resync() method in order

to get the datalink buffers to pick up the refreshed record as well. ...

I have two questions at this point :
1. The TIBOQuery does have one InvalidateRowNum(), but it needs a RowNum

integer parameter, but I don't see any RowNum property in the TIBOQuery.

How do I get this value? I'm guessing wildly here, but can I use
TIBOQuery1.InternalDataset.RowNum? (Untested yet, sorry).

2. The documentation of Resync() in Delphi (the IBO help file said that
this is just an override for the default TDataset method) said something

like the following :
...
Re-fetches the active record and the records that precede and follow it.
type TResyncMode = set of (rmExact, rmCenter); procedure Resync(Mode:
TResyncMode); virtual; ... Description

Resync is used internally by other dataset methods to resynchronize the
dataset with underlying physical data when making calls that may change
the internal cursor position. Applications should use the Refresh method

instead of calling Resync.
<snip>
...
Note the last sentence; "should use Refresh instead of calling Resync".
But in this case TIBOQuery.Refresh() seems to refresh everything, not
just the current record. Can anyone clarify how I should do this
'properly' ?

Many thanks in advance,
sugi.





















________________________________________________________________________
___
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/