Board index » delphi » D6 Master Detail IBQuery not synced

D6 Master Detail IBQuery not synced

I am having data sync problems when using two TIBQueries with a
Master/detail situation.  If I view the master with a grid and the
details with a grid it works just fine.  I scroll a record in the
master and the details updates.

If I view a couple of detailed fields with TDBEdits then the TDBEdit
fields do not get updated all of the time, just sometimes.  And when
it does update, it updates to the previous record.  BUT the grid is
still up to date.

I found this error in my main app and successfully recreated it in a
simple test program.  The app was working great in Delphi 5 with IBX
4.52.

I am currently running Interbase 6 and Delphi 6.

Any ideas?

Peter

 

Re:D6 Master Detail IBQuery not synced


I am able to reproduce this.  I'll look at it in the next day or two.

Quote
Cadvision wrote:

> I am having data sync problems when using two TIBQueries with a
> Master/detail situation.  If I view the master with a grid and the
> details with a grid it works just fine.  I scroll a record in the
> master and the details updates.

> If I view a couple of detailed fields with TDBEdits then the TDBEdit
> fields do not get updated all of the time, just sometimes.  And when
> it does update, it updates to the previous record.  BUT the grid is
> still up to date.

> I found this error in my main app and successfully recreated it in a
> simple test program.  The app was working great in Delphi 5 with IBX
> 4.52.

> I am currently running Interbase 6 and Delphi 6.

> Any ideas?

> Peter

--
Jeff Overcash (TeamB)   I don't think there are any Russians
(Please do not email    And there ain't no Yanks
 me directly unless     Just corporate criminals
 asked.  Thank You)     Playing with tanks.  (Michael Been)

Re:D6 Master Detail IBQuery not synced


Try this.  When you scroll try clicking in one of the edit fields that isn't
displaying anything.  For me it shows then.  A workaround is to find the
IBCustomDataset's RefreshParams and comment out the DisableControls and
EnableControls lines and statically link in the changed code.

Quote
Cadvision wrote:

> I am having data sync problems when using two TIBQueries with a
> Master/detail situation.  If I view the master with a grid and the
> details with a grid it works just fine.  I scroll a record in the
> master and the details updates.

> If I view a couple of detailed fields with TDBEdits then the TDBEdit
> fields do not get updated all of the time, just sometimes.  And when
> it does update, it updates to the previous record.  BUT the grid is
> still up to date.

> I found this error in my main app and successfully recreated it in a
> simple test program.  The app was working great in Delphi 5 with IBX
> 4.52.

> I am currently running Interbase 6 and Delphi 6.

> Any ideas?

> Peter

--
Jeff Overcash (TeamB)   I don't think there are any Russians
(Please do not email    And there ain't no Yanks
 me directly unless     Just corporate criminals
 asked.  Thank You)     Playing with tanks.  (Michael Been)

Re:D6 Master Detail IBQuery not synced


That was the fix.  Thanks

"Jeff Overcash (TeamB)" <overc...@onramp.net> wrote in message
news:3B4BC960.13138907@onramp.net...

Quote
> Try this.  When you scroll try clicking in one of the edit fields that
isn't
> displaying anything.  For me it shows then.  A workaround is to find the
> IBCustomDataset's RefreshParams and comment out the DisableControls and
> EnableControls lines and statically link in the changed code.

> Cadvision wrote:

> > I am having data sync problems when using two TIBQueries with a
> > Master/detail situation.  If I view the master with a grid and the
> > details with a grid it works just fine.  I scroll a record in the
> > master and the details updates.

> > If I view a couple of detailed fields with TDBEdits then the TDBEdit
> > fields do not get updated all of the time, just sometimes.  And when
> > it does update, it updates to the previous record.  BUT the grid is
> > still up to date.

> > I found this error in my main app and successfully recreated it in a
> > simple test program.  The app was working great in Delphi 5 with IBX
> > 4.52.

> > I am currently running Interbase 6 and Delphi 6.

> > Any ideas?

> > Peter

> --
> Jeff Overcash (TeamB)   I don't think there are any Russians
> (Please do not email    And there ain't no Yanks
>  me directly unless     Just corporate criminals
>  asked.  Thank You)     Playing with tanks.  (Michael Been)

Re:D6 Master Detail IBQuery not synced


Well it kinda of fix the problem.  It actually fixed the problem that I was
talking about but it now causes me no end of trouble with "grid out of
index" error.  I put the statements back in and the grid problems go away
but the previous field problem comes back.

Any more ideas?

Thanks again for the help.
Peter

Quote
"Peter Best" <pb...@greenpointsoftware.com> wrote in message

news:3b4cc021_1@dnews...
Quote
> That was the fix.  Thanks

Re:D6 Master Detail IBQuery not synced


I've only had time to identify what is going on, not what has changed in the VCL
to cause it.

Quote
Peter Best wrote:

> Well it kinda of fix the problem.  It actually fixed the problem that I was
> talking about but it now causes me no end of trouble with "grid out of
> index" error.  I put the statements back in and the grid problems go away
> but the previous field problem comes back.

> Any more ideas?

> Thanks again for the help.
> Peter

> "Peter Best" <pb...@greenpointsoftware.com> wrote in message
> news:3b4cc021_1@dnews...
> > That was the fix.  Thanks

--
Jeff Overcash (TeamB)   I don't think there are any Russians
(Please do not email    And there ain't no Yanks
 me directly unless     Just corporate criminals
 asked.  Thank You)     Playing with tanks.  (Michael Been)

Re:D6 Master Detail IBQuery not synced


This turns out to not be a IBX bug at all.  Change TFieldDataLink's UpdateField
to

procedure TFieldDataLink.UpdateField;
begin
  SetField(nil);
  if Active and (FFieldName <> '') then
  begin
    if Assigned(FControl) then
      SetField(GetFieldProperty(DataSource.DataSet, FControl, FFieldName)) else
      SetField(DataSource.DataSet.FieldByName(FFieldName));
  end
end;

and statically link in the changed pas file.  This bug was in D5 shipping, fixed
in SP1 but for some reason reverted back in D6 to the buggy version.

Quote
Cadvision wrote:

> I am having data sync problems when using two TIBQueries with a
> Master/detail situation.  If I view the master with a grid and the
> details with a grid it works just fine.  I scroll a record in the
> master and the details updates.

> If I view a couple of detailed fields with TDBEdits then the TDBEdit
> fields do not get updated all of the time, just sometimes.  And when
> it does update, it updates to the previous record.  BUT the grid is
> still up to date.

> I found this error in my main app and successfully recreated it in a
> simple test program.  The app was working great in Delphi 5 with IBX
> 4.52.

> I am currently running Interbase 6 and Delphi 6.

> Any ideas?

> Peter

--
Jeff Overcash (TeamB)   I don't think there are any Russians
(Please do not email    And there ain't no Yanks
 me directly unless     Just corporate criminals
 asked.  Thank You)     Playing with tanks.  (Michael Been)

Re:D6 Master Detail IBQuery not synced


We are also having big problems with the master detail syncing, before
upgrading to D6 we need to have that problem fixed.

Quote
> and statically link in the changed pas file.  This bug was in D5 shipping,
fixed
> in SP1 but for some reason reverted back in D6 to the buggy version.

My question:
My application is divided in a number of packages,
one of these packages contains the db connections and is required by the
other packages.

How can I use the patch described in the previous posting ?

I included the file dbctrls.pas in this package containing all db
connections and changed it as recommended.

Of course D6 can't compile the package:

[Error] SDBT.dpk(81): Package 'vcldb' already contains unit 'DBCtrls'

How can I solve that problem ??

Thanks !

Franz Schober
franz.scho...@firmos.com

Re:D6 Master Detail IBQuery not synced


You can't.  vcldb60.bpl can not be a required package.  It must be statically
linked in to your application.  That means anything that requires vcldb60.bpl
also must be statically linked in.  You don't have the necessary files nor are
you allowed to by license to recompile the Borland supplied libraries.  

I've already talked with Borland about this and it should be addressed in the
first patch (if there is a patch), but patches tend to come about 3 months after
the release so we are probably at least 2 months away from a package fix.  I am
only guessing on an ETA for  patch, I have no knowledge of if or when a patch
will occur.  I'd be surprised if there isn't a patch though.

Quote
Franz Schober wrote:

> I included the file dbctrls.pas in this package containing all db
> connections and changed it as recommended.

> Of course D6 can't compile the package:

> [Error] SDBT.dpk(81): Package 'vcldb' already contains unit 'DBCtrls'

> How can I solve that problem ??

> Thanks !

> Franz Schober
> franz.scho...@firmos.com

--
Jeff Overcash (TeamB)   I don't think there are any Russians
(Please do not email    And there ain't no Yanks
 me directly unless     Just corporate criminals
 asked.  Thank You)     Playing with tanks.  (Michael Been)

Re:D6 Master Detail IBQuery not synced


What do you mean by "statically link"??  Include in "uses"?

Quote
> and statically link in the changed pas file.  This bug was in D5 shipping,
fixed
> in SP1 but for some reason reverted back in D6 to the buggy version.

Re:D6 Master Detail IBQuery not synced


I'm a latecomer to this thread. I modified the code as suggested, and added
the changed pas file to my project, but the problem wasn't solved.
Am i missing anything?

"Jeff Overcash (TeamB)" <overc...@onramp.net> wrote in message
news:3B547877.50FBA91C@onramp.net...

Quote
> This turns out to not be a IBX bug at all.  Change TFieldDataLink's
UpdateField
> to

> procedure TFieldDataLink.UpdateField;
> begin
>   SetField(nil);
>   if Active and (FFieldName <> '') then
>   begin
>     if Assigned(FControl) then
>       SetField(GetFieldProperty(DataSource.DataSet, FControl, FFieldName))
else
>       SetField(DataSource.DataSet.FieldByName(FFieldName));
>   end
> end;

> and statically link in the changed pas file.  This bug was in D5 shipping,
fixed
> in SP1 but for some reason reverted back in D6 to the buggy version.

Re:D6 Master Detail IBQuery not synced


You aren't using packages right?  Everything must be statically linked in to get
the change to hold.  This is the same bug as what shipped in D5 with the exact
same solution.

Quote
kodiak wrote:

> I'm a latecomer to this thread. I modified the code as suggested, and added
> the changed pas file to my project, but the problem wasn't solved.
> Am i missing anything?

--
Jeff Overcash (TeamB)   I don't think there are any Russians
(Please do not email    And there ain't no Yanks
 me directly unless     Just corporate criminals
 asked.  Thank You)     Playing with tanks.  (Michael Been)

Re:D6 Master Detail IBQuery not synced


Jeff - i must be missing something. What is the right or wrong way to use a
package?
I added dbstrls to my project.. Is this enough?

Sorry for the email, it was sent by mistake

Quote
> You aren't using packages right?  Everything must be statically linked in
to get
> the change to hold.  This is the same bug as what shipped in D5 with the
exact
> same solution.

Re:D6 Master Detail IBQuery not synced


You can't use packages.  EVen if you add the pas file to your project, if you
add a package that has that unit the compiler/linker will grab the package
version and link it in.  When you have to change the VCL to fix a bug just turn
off package totally and statically link in the VCL.

Quote
kodiak wrote:

> Jeff - i must be missing something. What is the right or wrong way to use a
> package?
> I added dbstrls to my project.. Is this enough?

> Sorry for the email, it was sent by mistake

> > You aren't using packages right?  Everything must be statically linked in
> to get
> > the change to hold.  This is the same bug as what shipped in D5 with the
> exact
> > same solution.

--
Jeff Overcash (TeamB)   I don't think there are any Russians
(Please do not email    And there ain't no Yanks
 me directly unless     Just corporate criminals
 asked.  Thank You)     Playing with tanks.  (Michael Been)

Re:D6 Master Detail IBQuery not synced


thanks!

Other Threads