Subject Re: CONNECTIING 2 ROWSETs
From Mervyn Bick <invalid@invalid.invalid>
Date Fri, 23 Jun 2017 10:08:02 +0200
Newsgroups dbase.getting-started

On 2017-06-22 2:36 PM, Mustansir Ghor wrote:
> Dear Mervyn
>
> Thank you. the demo is very useful.
>
> It means when we connect 2 rowsets master and child, then child has to be indexed not the master, the navigation is done by master, i.e when we navigate in master corresponding child records are selected. This is just the opposite of what we used to do with SET RELATION TO where we navigate by child (default) and corresponding master was selected. If I were to get this setup do you think sqllookup might seem to be appropriate solution.

lookupSQL is not appropriate for what you want.  Firstly, the grid would
only show one record for each customer.  If the lookup table contains
more than one record for each customer lookupSQL would not know which
record to use and would, therefore, simply show a blank.

>
> However the use of inner join to put fields from both rowsets might be more useful in reports I guess, as the resulting rowset is not updatable.

The dBASE report engine can handle multiple tables but it can run into
problems where more than two tables are involved.  I always use joined
tables for reports with more than one table.  It is usually easier to
set up and there are never problems.

A rowset formed by joining tables is read-only.  On the other hand, I
never use a grid for editing as I feel it is too easy to make mistakes.

Editing or appending is done using un-linked entryfields which can
either be on the same form or on a subsidiary form.  Changes are written
back to the individual tables and the query with the joined tables is
requeried so as to bring the grid up to date.

Mervyn.