Subject Re: Parent/Child
From Gaetano D. <gaetanodd@hotmail.com>
Date Thu, 6 May 2021 18:49:06 +1000
Newsgroups dbase.getting-started


Hi Mervyn,

How can you remember these things? I have purchased a fair few versions
of dBase: VDB7, dB2K ( I didn't remember that was a subscription until I
searched my archives for some other reason this morning), dBase 2.01.
dBase 2.6, Plus9, Plus11 and dBase 2019, but dBase 2.6 is dated 2005 on
my CD, so the fact that you are remembering details to that level nearly
15 year later is mind boggling to me. Many thanks for your good RAM,
errrr memory ;)

Gaetano.

On 6/05/2021 18:17, Mervyn Bick wrote:
> On 2021/05/05 18:08, Bob McKinney wrote:
>> Hi All:  Using dB Plus 2.8 w/win/10, age 97 (have forgotten a lot) .
>> I can no longer establish
>> Parent/ Child relations when creating a new datamodule.  I tried to
>> reinstall dB from my
>> backup disk but it won't install, in case dB acquired a glitch of
>> some kind.
>>     I only code for my personal use.  Any help regaining this
>> capability of dB would be a great help as I am now having to try to
>> code workarounds.  Not too great.  I know it's old code, but maybe
>> someone knows how to regain this feature.  Thanks for any help.......Bob
>>
>
> Re-installing dBASE Plus 2.8 over a corrupt copy may work but there is
> also the chance that you will wind up with no dBASE at all.  You
> should only consider this is if you have your dBASE 2.7 licence which
> will enable you to start from scratch.
>
> As I remember it, dBASE Plus 2.8 was a free upgrade to dBASE Plus 2.7.
> If your copy of dBASE Plus 2.8 is corrupt and if you have your licence
> for dBASE Plus 2.7 you can download and install dBASE Plus 2.7 from
> http://www.dbase.com/support/updates-and-fixes/ Once that is done you
> can download and install dBASE Plus2.8 over it.
>
> If you no longer have your dBASE Plus 2.7 licence you can try writing
> to customerservice@dbasellc.com where they may be able to help you.
> This may, however, be a bit of a long shot as the present owners of
> dBASE may not have access to those records.
>
> There have been changes to the datamodule designer over the years. I
> never used dBASE 2.8 so I can't help you with the datamodule designer
>
> Datamodules are very useful especially where many of the same tables
> are used on many forms.  One does not, however, need to use them.  It
> may be a bit more work but there is nothing to stop you from adding
> all the tables to each form instead of a single datamodule.
>
> Once you have added tables to a datamodule (or a form) you can set the
> relationship by using the sourcecode editor.
>
> There are two different ways of setting up a parent/child relationship
> but let's stay with the more traditional one here.
>
> You need to open each table in it's own query.  The parent table need
> not be indexed but you can use an index if you want.  This index can
> be on any field in the parent table.
>
> The child table MUST be indexed on the field that is used to link it
> to its parent.
>
> You need to set three things for the child rowset.
>
>   1  The indexname for the child rowset.  The indexname is not
> important. It's index expression must, however, have the linking field
> at the start of the expression if it is a complex index.
>   2  Assign the parent rowset to to the child rowset's masterRowset
> property.
>   3  Assign the name of the linking field in the child rowset to the
> child rowset's masterFields property.
>
> Once this has been done selecting a record in the parent rowset will
> automatically select the appropriate records in the child rowset.
>
>    this.PARENT1 = new QUERY(this)
>    with (this.PARENT1)
>       left = 4.0
>       width = 10.0
>       height = 1.0
>       sql = 'select * from "parent.DBF"'
>       active = true
>    endwith
>
>
>    this.CHILD1 = new QUERY(this)
>    with (this.CHILD1)
>       left = 13.0
>       width = 7.0
>       height = 1.0
>       sql = 'select * from "child.DBF"'
>       active = true
>    endwith
>
>    with (this.CHILD1.rowset)
>       indexName = "CHILDID"  // name of index for child table
>       masterRowset = form.parent1.rowset //parent rowset
>       masterFields = "childid" // name of linking field in parent table
>    endwith
>
>
> Mervyn.