Board index » delphi » Master/Detail on Compound Index

Master/Detail on Compound Index

To All

Does anyone know of a way to setup a Master->Detail relationship based
on compound index tag?

I'm using FoxPro tables in which the child table records are uniquely
identified by a series of their fields  (STR(ACCT_NO,6) +
DTOC(BILL_DATE) + POSTED {posted is a character size 1)
The indexed field in the Master table is ACCT_NO whose expression is
STR(ACCT_NO,6).

The BDE complains with the message "Field Index Out Of Range".  Are
there some obscure BDE
functions that might help me achieve this sort of relationship?
Otherwise I fear I'm in for a lot of hand codeing to keep the child
table in the order I need but only work with the records belonging to
the current parent.

Thanks

Joe
jkocin...@toltbbs.com

 

Re:Master/Detail on Compound Index


Quote
>Does anyone know of a way to setup a Master->Detail relationship based
>on compound index tag?

Not possable.  BDE does not support links on expression indexes.

--
Brian Bushay (TeamB)
Bbus...@DataGuidance.com

Re:Master/Detail on Compound Index


The only way to achieve this type of relationship is to link the two files
on the primary one and then set a filter for the rest. eg link on the ACCT
fields then apply a filter for the other two.  Place code on the dataset
onchange event of the header file so that when the header record changes the
child table will also update.

If you have any q's send me an email.

Regards
Kelvin Taite

kta...@cableatlantic.nf.ca
dkt...@email.msn.com

Quote
Joseph F Kocinski wrote in message <34C2BB8F.1984D...@toltbbs.com>...
>To All

>Does anyone know of a way to setup a Master->Detail relationship based
>on compound index tag?

>I'm using FoxPro tables in which the child table records are uniquely
>identified by a series of their fields  (STR(ACCT_NO,6) +
>DTOC(BILL_DATE) + POSTED {posted is a character size 1)
>The indexed field in the Master table is ACCT_NO whose expression is
>STR(ACCT_NO,6).

>The BDE complains with the message "Field Index Out Of Range".  Are
>there some obscure BDE
>functions that might help me achieve this sort of relationship?
>Otherwise I fear I'm in for a lot of hand codeing to keep the child
>table in the order I need but only work with the records belonging to
>the current parent.

>Thanks

>Joe
>jkocin...@toltbbs.com

Re:Master/Detail on Compound Index


On Sun, 18 Jan 1998 21:33:53 -0500, Joseph F Kocinski

Quote
<jkocin...@toltbbs.com> wrote:
>Does anyone know of a way to setup a Master->Detail relationship based
>on compound index tag?

>I'm using FoxPro tables...

dBASE (and FoxPro) compound indexes (aka expression indexes) function
different from the compound indexes for all other table types you can
access from Delphi. Instead of basing the index on true multiple field
values, the field values are combined into a single value, or expression.
The design scheme of Delphi and the BDE is to be as generic as possible to
all table types, using the same code functionality for all. Unfortunately,
the nonstandard nature of dBASE (and FoxPro) expression indexes do not
always fit in well with this design.

One manifestation of this difference in index functionality when used in
Delphi applications is the Master-Detail linking. It cannot be based on
these types of indexes. See the Technical Information sheet TI2838, "dBASE
Expression Indexes: a Primer," for more on creating and using expression
indexes in Delphi applications. Technical Information sheets (TIs) on
various topics for all Borland products can easily be obtained through a
variety of sources. The Borland Web site has a search engine for technical
documents at the URL:

  http://www.borland.com/search/

You can emulate a Master-Detail link when using an expression index by:

1. Trapping movement of the Master table record pointer (TTable.AfterScroll

   event) and refiltering the TTable representing the Detail table.

2. Trapping insertion of new Detail table records (TTable.AfterInsert and
   TTable.OnNewRecord) and copying the Master table key field value(s) to
   the detail table.

**************************************************************************
Steve Koterski
Borland International, Inc.
http://www.borland.com/delphi
(Remove the "SPICEDHAM2" from the address. Death to spam-bots!)

Re:Master/Detail on Compound Index


I think the right way to do this is use the TDataSource.OnDataChange event,
because the onscroll event does not work with all movements in the
recordpointer.

Quote
Steve Koterski wrote:
> On Sun, 18 Jan 1998 21:33:53 -0500, Joseph F Kocinski
> <jkocin...@toltbbs.com> wrote:

> >Does anyone know of a way to setup a Master->Detail relationship based
> >on compound index tag?

> >I'm using FoxPro tables...

> dBASE (and FoxPro) compound indexes (aka expression indexes) function
> different from the compound indexes for all other table types you can
> access from Delphi. Instead of basing the index on true multiple field
> values, the field values are combined into a single value, or expression.
> The design scheme of Delphi and the BDE is to be as generic as possible to
> all table types, using the same code functionality for all. Unfortunately,
> the nonstandard nature of dBASE (and FoxPro) expression indexes do not
> always fit in well with this design.

> One manifestation of this difference in index functionality when used in
> Delphi applications is the Master-Detail linking. It cannot be based on
> these types of indexes. See the Technical Information sheet TI2838, "dBASE
> Expression Indexes: a Primer," for more on creating and using expression
> indexes in Delphi applications. Technical Information sheets (TIs) on
> various topics for all Borland products can easily be obtained through a
> variety of sources. The Borland Web site has a search engine for technical
> documents at the URL:

>   http://www.borland.com/search/

> You can emulate a Master-Detail link when using an expression index by:

> 1. Trapping movement of the Master table record pointer (TTable.AfterScroll

>    event) and refiltering the TTable representing the Detail table.

> 2. Trapping insertion of new Detail table records (TTable.AfterInsert and
>    TTable.OnNewRecord) and copying the Master table key field value(s) to
>    the detail table.

> **************************************************************************
> Steve Koterski
> Borland International, Inc.
> http://www.borland.com/delphi
> (Remove the "SPICEDHAM2" from the address. Death to spam-bots!)

--
Attorney by Day
Mathematics, Mozart, Delphi
and Family.

Other Threads