Subject Re: Data module with a complex index
From wjs <nobody@nowhere.com>
Date Sun, 8 Dec 2019 07:15:55 +0200
Newsgroups dbase.getting-started

On 2019-12-06 11:39 AM, Robbie Nott wrote:
>
Hi Robbie
Did you consider masterRowset and masterField using your index ?
Attached a simple dataModule I use to show a selected horse's endurance
performance.
Hope it helps.

Wian
-------------------------------------------------

/*
Created 2017/06/08
Data module to use as finder for horse EDR performance
2017/10/24 Link enduro to HorseNames with the H_ID and use the new
complex index HIDDOR
            created on H_ID + DOR in order to have the results ordered
by date.
            Further, note the setup of the Enduro.dbf (as Results1
query) AND THE navigateByMaster = true !!!
            This last setting allows me to use the HORSECODE field of
the Enduro.dbf in the same grid as the HorseNames.dbf fields !!
NOTE NOTE: The form MUST MUST have this EDR_NAMES1 rowset as the form's
rowset else the setup of the
            Names grid using the Enduro HORSECODE field will NOT WORK !
*/

class EDR_HRES_DM of DATAMODULE
    with (this)
       left = -1.0
       top = -1.0
    endwith

    this.EDR_NAMES1 = new WS_QUERY()
    this.EDR_NAMES1.parent = this
    with (this.EDR_NAMES1)
       left = 5.0
       top = -20.0
       sql = 'select * from "HorseNames.dbf" where IS_EDR = true'
       requestLive = false  //make this a non-editable rowset !
       active = true
    endwith

    with (this.EDR_NAMES1.rowset)
       indexName = "HNME"
    endwith

    this.RESULTS1 = new WS_QUERY()
    this.RESULTS1.parent = this
    with (this.RESULTS1)
       left = 66.0
       top = -21.0
       sql = 'select * from "Enduro.DBF"'
       active = true
    endwith

    with (this.RESULTS1.rowset)
       indexName = "HIDDOR"
       masterRowset = form.edr_names1.rowset
       masterFields = "H_ID"
       navigateByMaster = true // See comment at top !!!!
    endwith

   this.rowset = this.edr_names1.rowset
   //NOTE NOTE: The form MUST MUST have this rowset as the form rowset else
   //           the setup of the Names grid will NOT WORK !
endClass


Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0