Subject Re: Problem with records disappear in dbgrid(detail db).
Author speedyc65
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
> At 01:18 PM 6/11/2003 +0000, you wrote:
> >--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
> > > At 09:56 PM 5/11/2003 +0000, you wrote:
> > >
> > > >Sorry I wrote KeyFields but I meant KeyLinks. So what you are
> >saying
> > > >that I have done it right in KeyLinks then, but why does the
lines
> > > >disappears after Post and then reappears when you do a Next /
> > > >Previous ?
> > >
> > > Some more questions --
> > > Are you calling Insert or Append?
> >I'm using a DBGrid so I don't know what it uses.
>
> I'll put the question another way. How are you causing the grid
to give
> you an empty row so that you can insert a new row?
>
I used the Insert key but I also tried to add a DBNavigator to the
same dataset and pressing Insert(+) and then Post(v) after putting
some info on the row. When either pressing TDBNavigator Post button
or leaving the row in the TDBGrid makes the row disappears. When I
do a Next and Previous on the master table the grid then shows all
rows including the newly posted one.

>
> > > Where do the PK values for your new rows come from? Does the
user
> >enter
> > > them, or are they generated/calculated on the server?
> > >
> >Two values come from OnNewRecord on the detail(TIBOTable) and the
> >last one is a generator. The generator is listed in the
GenatorLinks
> >in the TIBODatabase.
>
> 1. What does the GeneratorLinks entry look like?
AVVIKELSE.NR=AVVIKELSE_NR_GEN
BESKRIVNING.NR=BESKRIVNING_NR_GEN
KOMPETENS.NR=KOMPETENS_NR_GEN
LONEART.NR=LONEART_NR_GEN
MTRL.NR=MTRL_NR_GEN
RISKER.NR=RISKER_NR_GEN
They all work the same way and get the same behaviour in a Grid.

> 2. Do you see the generator value in the grid when the
new "empty" row
> appears?
Yes.

> 3. Do you see the other key values?
Yes.

> Your new rows are going to get "lost" (from the point of view of
the
> dataset) if those key values are not available to put into the Key
buffer.
>
If followed you all the way to here. The row is posted and should
still be the current. Why are the key values not available ?
if the UPDATE command to the server didnt report an error why are
the buffer emptied ?

> Helen