Board index » delphi » Master/Detail entry form. Detail dissapear

Master/Detail entry form. Detail dissapear

I'm moving from Paradox to Oracle. I used to use tables and now, I changed
everthing to Querys. But I have a problem with master/detail entry forms.

On these forms, after inserting a record, this new record is not visible
until a new Select operation. Is this ok?

I tried to fix it closing and reopening the query in the after post event
but it's slow , is there a way to handle this problem?

I'm not using cached updates.

thanks

Luis Cantu

 

Re:Master/Detail entry form. Detail dissapear


  Hello,
        First, it's strongly suggested to use Cached updates to Work with
SQL Servers.
        Then, if you're using a master/detail form, you must append in the
detail query
       the key of the master. When you execute the applyupdates command of
TQuery,
you have to apply first to the master and then to detail. There's no problem
if the new
record is not visible at first....Don't use close/open, or else you 'll
waste the cache.

Luis Cantu escreveu na mensagem <7j9afi$o...@forums.borland.com>...

Quote
>I'm moving from Paradox to Oracle. I used to use tables and now, I changed
>everthing to Querys. But I have a problem with master/detail entry forms.

>On these forms, after inserting a record, this new record is not visible
>until a new Select operation. Is this ok?

>I tried to fix it closing and reopening the query in the after post event
>but it's slow , is there a way to handle this problem?

>I'm not using cached updates.

>thanks

>Luis Cantu

Re:Master/Detail entry form. Detail dissapear


Hi Luis!

On Fri, 4 Jun 1999 13:47:51 -0500, "Luis Cantu" <glyp...@infolnk.net>
wrote:

Quote
>I'm moving from Paradox to Oracle. I used to use tables and now, I changed
>everthing to Querys. But I have a problem with master/detail entry forms.

>On these forms, after inserting a record, this new record is not visible
>until a new Select operation. Is this ok?

>I tried to fix it closing and reopening the query in the after post event
>but it's slow , is there a way to handle this problem?

You should put your TQuery.RequestLive := false, and
TQuery.CachedUpdates := true, then that should be fine.

But if you use cached updates than you have to perform apply updates
to database yourself and the best way to do that is via
TDatabase.ApplyUpdates method where you can pass an open array of
datasets like [quDetail, quMaster].

The order of datasets in ApplyUpdates is important because if you have
modifications in both master and detail dataset and they are linked
through datasource than you will lose changes in detail when master is
applyed.

tomi.

Other Threads