In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

oDataSet:SetRelation()

Xailer professional forum in English
Responder
g.s.rogers
Mensajes: 202
Registrado: Dom Feb 17, 2008 3:35 am

oDataSet:SetRelation()

Mensaje por g.s.rogers »

I am trying to display two DBBrowse objects in a form with a parent/child
relationship between them.
oDbfDataSetFeeGroups is the Parent.
oDbfDataSetGroupAllocations is the Child
The foreign key in the Child is field ALLOCID and the Child dbf is indexed
on that field. It is the only index for the child table.
Here is what I put in the oForm:Initialize() event:
::oDbfDataSetFeeGroups:Select()
::oDBfDataSetFeeGroups:SetRelation("Allocid" ,
::oDbfDataSetGroupAllocations)
::oDbfDataSetFeeGroups:GoTop() // probably not needed
::oDBBrowseFeeGroups:GoTop()
::oDBBrowseFeeGroups:SetFocus()
The Parent DBBrowse shows records, the Child DBBrowse object does not. I
have verified that I have sample data in the child dbf that matches parent
records.
Why doesn't this work?
TIA,
Gary
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9440
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

oDataSet:SetRelation()

Mensaje por ignacio »

Gary,
The foreign key is always in the master table and the index is on the child
table. So, the field name should be a master table FIELD. The index
expressión on the Child table must match with that master field.
Regards,
--
Ignacio Ortiz de Zúñiga
[Soporte Xailer]
[Xailer support]
"Gary S. Rogers" <g.s.rogers@att.net> escribió en el mensaje
news:[email=48ea7c40@ozsrv2.ozlan.local...]48ea7c40@ozsrv2.ozlan.local...[/email]
>I am trying to display two DBBrowse objects in a form with a parent/child
>relationship between them.
>
> oDbfDataSetFeeGroups is the Parent.
> oDbfDataSetGroupAllocations is the Child
> The foreign key in the Child is field ALLOCID and the Child dbf is indexed
> on that field. It is the only index for the child table.
>
> Here is what I put in the oForm:Initialize() event:
>
> ::oDbfDataSetFeeGroups:Select()
> ::oDBfDataSetFeeGroups:SetRelation("Allocid" ,
> ::oDbfDataSetGroupAllocations)
>
> ::oDbfDataSetFeeGroups:GoTop() // probably not needed
> ::oDBBrowseFeeGroups:GoTop()
> ::oDBBrowseFeeGroups:SetFocus()
>
> The Parent DBBrowse shows records, the Child DBBrowse object does not. I
> have verified that I have sample data in the child dbf that matches parent
> records.
>
> Why doesn't this work?
> TIA,
> Gary
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
NoName
Mensajes: 531
Registrado: Vie Feb 03, 2006 7:27 pm

oDataSet:SetRelation()

Mensaje por NoName »

Gary,
The foreign key is always in the master table and the index is on the child
table. So, the field name should be a master table FIELD. The index
expressión on the Child table must match with that master field.
Regards,
--
Ignacio Ortiz de Zúñiga
[Soporte Xailer]
[Xailer support]
"Gary S. Rogers" <g.s.rogers@att.net> escribió en el mensaje
news:[email=48ea7c40@ozsrv2.ozlan.local...]48ea7c40@ozsrv2.ozlan.local...[/email]
>I am trying to display two DBBrowse objects in a form with a parent/child
>relationship between them.
>
> oDbfDataSetFeeGroups is the Parent.
> oDbfDataSetGroupAllocations is the Child
> The foreign key in the Child is field ALLOCID and the Child dbf is indexed
> on that field. It is the only index for the child table.
>
> Here is what I put in the oForm:Initialize() event:
>
> ::oDbfDataSetFeeGroups:Select()
> ::oDBfDataSetFeeGroups:SetRelation("Allocid" ,
> ::oDbfDataSetGroupAllocations)
>
> ::oDbfDataSetFeeGroups:GoTop() // probably not needed
> ::oDBBrowseFeeGroups:GoTop()
> ::oDBBrowseFeeGroups:SetFocus()
>
> The Parent DBBrowse shows records, the Child DBBrowse object does not. I
> have verified that I have sample data in the child dbf that matches parent
> records.
>
> Why doesn't this work?
> TIA,
> Gary
g.s.rogers
Mensajes: 202
Registrado: Dom Feb 17, 2008 3:35 am

oDataSet:SetRelation()

Mensaje por g.s.rogers »

Ignacio,
I got my definition of foreign key wrong in my explanation. The Master
(Parent) table does have the field ALLOCID and the child table is indexed on
ALLOCID. I'm going to run the program under debug to verify that the child
index is active and that the index key is what I think it is.
Is the oForm:Initialize() the correct place to establish the relation? Once
the relationship is set, is there any other methods that need to be used to
keep the two DBBrowse objects in synch?
Thanks for your help,
Gary
"Ignacio Ortiz de Zúñiga" <NoName@xailer.com> wrote in message
news:48eb10f2$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Gary,
>
> The foreign key is always in the master table and the index is on the
> child table. So, the field name should be a master table FIELD. The index
> expressión on the Child table must match with that master field.
>
> Regards,
>
> --
> Ignacio Ortiz de Zúñiga
> [Soporte Xailer]
> [Xailer support]
>
>
> "Gary S. Rogers" <g.s.rogers@att.net> escribió en el mensaje
> news:[email=48ea7c40@ozsrv2.ozlan.local...]48ea7c40@ozsrv2.ozlan.local...[/email]
>>I am trying to display two DBBrowse objects in a form with a parent/child
>>relationship between them.
>>
>> oDbfDataSetFeeGroups is the Parent.
>> oDbfDataSetGroupAllocations is the Child
>> The foreign key in the Child is field ALLOCID and the Child dbf is
>> indexed on that field. It is the only index for the child table.
>>
>> Here is what I put in the oForm:Initialize() event:
>>
>> ::oDbfDataSetFeeGroups:Select()
>> ::oDBfDataSetFeeGroups:SetRelation("Allocid" ,
>> ::oDbfDataSetGroupAllocations)
>>
>> ::oDbfDataSetFeeGroups:GoTop() // probably not needed
>> ::oDBBrowseFeeGroups:GoTop()
>> ::oDBBrowseFeeGroups:SetFocus()
>>
>> The Parent DBBrowse shows records, the Child DBBrowse object does not. I
>> have verified that I have sample data in the child dbf that matches
>> parent records.
>>
>> Why doesn't this work?
>> TIA,
>> Gary
>
>
g.s.rogers
Mensajes: 202
Registrado: Dom Feb 17, 2008 3:35 am

oDataSet:SetRelation()

Mensaje por g.s.rogers »

Ignacio,
I got my definition of foreign key wrong in my explanation. The Master
(Parent) table does have the field ALLOCID and the child table is indexed on
ALLOCID. I'm going to run the program under debug to verify that the child
index is active and that the index key is what I think it is.
Is the oForm:Initialize() the correct place to establish the relation? Once
the relationship is set, is there any other methods that need to be used to
keep the two DBBrowse objects in synch?
Thanks for your help,
Gary
"Ignacio Ortiz de Zúñiga" <NoName@xailer.com> wrote in message
news:48eb10f2$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Gary,
>
> The foreign key is always in the master table and the index is on the
> child table. So, the field name should be a master table FIELD. The index
> expressión on the Child table must match with that master field.
>
> Regards,
>
> --
> Ignacio Ortiz de Zúñiga
> [Soporte Xailer]
> [Xailer support]
>
>
> "Gary S. Rogers" <g.s.rogers@att.net> escribió en el mensaje
> news:[email=48ea7c40@ozsrv2.ozlan.local...]48ea7c40@ozsrv2.ozlan.local...[/email]
>>I am trying to display two DBBrowse objects in a form with a parent/child
>>relationship between them.
>>
>> oDbfDataSetFeeGroups is the Parent.
>> oDbfDataSetGroupAllocations is the Child
>> The foreign key in the Child is field ALLOCID and the Child dbf is
>> indexed on that field. It is the only index for the child table.
>>
>> Here is what I put in the oForm:Initialize() event:
>>
>> ::oDbfDataSetFeeGroups:Select()
>> ::oDBfDataSetFeeGroups:SetRelation("Allocid" ,
>> ::oDbfDataSetGroupAllocations)
>>
>> ::oDbfDataSetFeeGroups:GoTop() // probably not needed
>> ::oDBBrowseFeeGroups:GoTop()
>> ::oDBBrowseFeeGroups:SetFocus()
>>
>> The Parent DBBrowse shows records, the Child DBBrowse object does not. I
>> have verified that I have sample data in the child dbf that matches
>> parent records.
>>
>> Why doesn't this work?
>> TIA,
>> Gary
>
>
g.s.rogers
Mensajes: 202
Registrado: Dom Feb 17, 2008 3:35 am

oDataSet:SetRelation()

Mensaje por g.s.rogers »

I've looked at the various debug windows and the child index is active and
the key is ALLOCID. There is apparently no way to inspect what relationships
might exist between datasets -- at least I haven't found a way to inspect
that.
Do I have the syntax correct? Is the relationship set in the Parent dataset
like I have it? oDataSetParent:setrelation(cKey,oDataSetChild)?
I really want to get past this problem because a lot of my apps screens will
use related browse objects.
Thanks,
Gary
"Ignacio Ortiz de Zúñiga" <NoName@xailer.com> wrote in message
news:48eb10f2$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Gary,
>
> The foreign key is always in the master table and the index is on the
> child table. So, the field name should be a master table FIELD. The index
> expressión on the Child table must match with that master field.
>
> Regards,
>
> --
> Ignacio Ortiz de Zúñiga
> [Soporte Xailer]
> [Xailer support]
>
>
> "Gary S. Rogers" <g.s.rogers@att.net> escribió en el mensaje
> news:[email=48ea7c40@ozsrv2.ozlan.local...]48ea7c40@ozsrv2.ozlan.local...[/email]
>>I am trying to display two DBBrowse objects in a form with a parent/child
>>relationship between them.
>>
>> oDbfDataSetFeeGroups is the Parent.
>> oDbfDataSetGroupAllocations is the Child
>> The foreign key in the Child is field ALLOCID and the Child dbf is
>> indexed on that field. It is the only index for the child table.
>>
>> Here is what I put in the oForm:Initialize() event:
>>
>> ::oDbfDataSetFeeGroups:Select()
>> ::oDBfDataSetFeeGroups:SetRelation("Allocid" ,
>> ::oDbfDataSetGroupAllocations)
>>
>> ::oDbfDataSetFeeGroups:GoTop() // probably not needed
>> ::oDBBrowseFeeGroups:GoTop()
>> ::oDBBrowseFeeGroups:SetFocus()
>>
>> The Parent DBBrowse shows records, the Child DBBrowse object does not. I
>> have verified that I have sample data in the child dbf that matches
>> parent records.
>>
>> Why doesn't this work?
>> TIA,
>> Gary
>
>
g.s.rogers
Mensajes: 202
Registrado: Dom Feb 17, 2008 3:35 am

oDataSet:SetRelation()

Mensaje por g.s.rogers »

I've looked at the various debug windows and the child index is active and
the key is ALLOCID. There is apparently no way to inspect what relationships
might exist between datasets -- at least I haven't found a way to inspect
that.
Do I have the syntax correct? Is the relationship set in the Parent dataset
like I have it? oDataSetParent:setrelation(cKey,oDataSetChild)?
I really want to get past this problem because a lot of my apps screens will
use related browse objects.
Thanks,
Gary
"Ignacio Ortiz de Zúñiga" <NoName@xailer.com> wrote in message
news:48eb10f2$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Gary,
>
> The foreign key is always in the master table and the index is on the
> child table. So, the field name should be a master table FIELD. The index
> expressión on the Child table must match with that master field.
>
> Regards,
>
> --
> Ignacio Ortiz de Zúñiga
> [Soporte Xailer]
> [Xailer support]
>
>
> "Gary S. Rogers" <g.s.rogers@att.net> escribió en el mensaje
> news:[email=48ea7c40@ozsrv2.ozlan.local...]48ea7c40@ozsrv2.ozlan.local...[/email]
>>I am trying to display two DBBrowse objects in a form with a parent/child
>>relationship between them.
>>
>> oDbfDataSetFeeGroups is the Parent.
>> oDbfDataSetGroupAllocations is the Child
>> The foreign key in the Child is field ALLOCID and the Child dbf is
>> indexed on that field. It is the only index for the child table.
>>
>> Here is what I put in the oForm:Initialize() event:
>>
>> ::oDbfDataSetFeeGroups:Select()
>> ::oDBfDataSetFeeGroups:SetRelation("Allocid" ,
>> ::oDbfDataSetGroupAllocations)
>>
>> ::oDbfDataSetFeeGroups:GoTop() // probably not needed
>> ::oDBBrowseFeeGroups:GoTop()
>> ::oDBBrowseFeeGroups:SetFocus()
>>
>> The Parent DBBrowse shows records, the Child DBBrowse object does not. I
>> have verified that I have sample data in the child dbf that matches
>> parent records.
>>
>> Why doesn't this work?
>> TIA,
>> Gary
>
>
Ingo JH
Mensajes: 358
Registrado: Lun Dic 10, 2007 5:10 pm

oDataSet:SetRelation()

Mensaje por Ingo JH »

Gary,
the FormInitialize method is the right place for that:
1. open both datasets (master and child)
2. set the indexorder (OrdSetFocus) of the child dataset to the tag which is
indexed on ALLOCID
3. then set the relation by the way:
oMasterDataset:SetRelation("ALLOCID",oChildDataset)
Regards
Ingo
"Gary S. Rogers" <g.s.rogers@att.net> schrieb im Newsbeitrag
news:48eb86a4$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Ignacio,
>
> I got my definition of foreign key wrong in my explanation. The Master
> (Parent) table does have the field ALLOCID and the child table is indexed
> on ALLOCID. I'm going to run the program under debug to verify that the
> child index is active and that the index key is what I think it is.
>
> Is the oForm:Initialize() the correct place to establish the relation?
> Once the relationship is set, is there any other methods that need to be
> used to keep the two DBBrowse objects in synch?
>
> Thanks for your help,
>
> Gary
>
>
>
> "Ignacio Ortiz de Zúñiga" <NoName@xailer.com> wrote in message
> news:48eb10f2$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>> Gary,
>>
>> The foreign key is always in the master table and the index is on the
>> child table. So, the field name should be a master table FIELD. The index
>> expressión on the Child table must match with that master field.
>>
>> Regards,
>>
>> --
>> Ignacio Ortiz de Zúñiga
>> [Soporte Xailer]
>> [Xailer support]
>>
>>
>> "Gary S. Rogers" <g.s.rogers@att.net> escribió en el mensaje
>> news:[email=48ea7c40@ozsrv2.ozlan.local...]48ea7c40@ozsrv2.ozlan.local...[/email]
>>>I am trying to display two DBBrowse objects in a form with a parent/child
>>>relationship between them.
>>>
>>> oDbfDataSetFeeGroups is the Parent.
>>> oDbfDataSetGroupAllocations is the Child
>>> The foreign key in the Child is field ALLOCID and the Child dbf is
>>> indexed on that field. It is the only index for the child table.
>>>
>>> Here is what I put in the oForm:Initialize() event:
>>>
>>> ::oDbfDataSetFeeGroups:Select()
>>> ::oDBfDataSetFeeGroups:SetRelation("Allocid" ,
>>> ::oDbfDataSetGroupAllocations)
>>>
>>> ::oDbfDataSetFeeGroups:GoTop() // probably not needed
>>> ::oDBBrowseFeeGroups:GoTop()
>>> ::oDBBrowseFeeGroups:SetFocus()
>>>
>>> The Parent DBBrowse shows records, the Child DBBrowse object does not. I
>>> have verified that I have sample data in the child dbf that matches
>>> parent records.
>>>
>>> Why doesn't this work?
>>> TIA,
>>> Gary
>>
>>
>
Ingo JH
Mensajes: 358
Registrado: Lun Dic 10, 2007 5:10 pm

oDataSet:SetRelation()

Mensaje por Ingo JH »

Gary,
the FormInitialize method is the right place for that:
1. open both datasets (master and child)
2. set the indexorder (OrdSetFocus) of the child dataset to the tag which is
indexed on ALLOCID
3. then set the relation by the way:
oMasterDataset:SetRelation("ALLOCID",oChildDataset)
Regards
Ingo
"Gary S. Rogers" <g.s.rogers@att.net> schrieb im Newsbeitrag
news:48eb86a4$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Ignacio,
>
> I got my definition of foreign key wrong in my explanation. The Master
> (Parent) table does have the field ALLOCID and the child table is indexed
> on ALLOCID. I'm going to run the program under debug to verify that the
> child index is active and that the index key is what I think it is.
>
> Is the oForm:Initialize() the correct place to establish the relation?
> Once the relationship is set, is there any other methods that need to be
> used to keep the two DBBrowse objects in synch?
>
> Thanks for your help,
>
> Gary
>
>
>
> "Ignacio Ortiz de Zúñiga" <NoName@xailer.com> wrote in message
> news:48eb10f2$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>> Gary,
>>
>> The foreign key is always in the master table and the index is on the
>> child table. So, the field name should be a master table FIELD. The index
>> expressión on the Child table must match with that master field.
>>
>> Regards,
>>
>> --
>> Ignacio Ortiz de Zúñiga
>> [Soporte Xailer]
>> [Xailer support]
>>
>>
>> "Gary S. Rogers" <g.s.rogers@att.net> escribió en el mensaje
>> news:[email=48ea7c40@ozsrv2.ozlan.local...]48ea7c40@ozsrv2.ozlan.local...[/email]
>>>I am trying to display two DBBrowse objects in a form with a parent/child
>>>relationship between them.
>>>
>>> oDbfDataSetFeeGroups is the Parent.
>>> oDbfDataSetGroupAllocations is the Child
>>> The foreign key in the Child is field ALLOCID and the Child dbf is
>>> indexed on that field. It is the only index for the child table.
>>>
>>> Here is what I put in the oForm:Initialize() event:
>>>
>>> ::oDbfDataSetFeeGroups:Select()
>>> ::oDBfDataSetFeeGroups:SetRelation("Allocid" ,
>>> ::oDbfDataSetGroupAllocations)
>>>
>>> ::oDbfDataSetFeeGroups:GoTop() // probably not needed
>>> ::oDBBrowseFeeGroups:GoTop()
>>> ::oDBBrowseFeeGroups:SetFocus()
>>>
>>> The Parent DBBrowse shows records, the Child DBBrowse object does not. I
>>> have verified that I have sample data in the child dbf that matches
>>> parent records.
>>>
>>> Why doesn't this work?
>>> TIA,
>>> Gary
>>
>>
>
g.s.rogers
Mensajes: 202
Registrado: Dom Feb 17, 2008 3:35 am

oDataSet:SetRelation()

Mensaje por g.s.rogers »

Ok, let me work with this. There may simply be a problem with my dataset.
Thanks for the input!
Gary
"Ingo" <support@mandantwin.com> wrote in message
news:48eb8b77$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Gary,
>
> the FormInitialize method is the right place for that:
> 1. open both datasets (master and child)
> 2. set the indexorder (OrdSetFocus) of the child dataset to the tag which
> is indexed on ALLOCID
> 3. then set the relation by the way:
> oMasterDataset:SetRelation("ALLOCID",oChildDataset)
>
> Regards
>
> Ingo
>
> "Gary S. Rogers" <g.s.rogers@att.net> schrieb im Newsbeitrag
> news:48eb86a4$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>> Ignacio,
>>
>> I got my definition of foreign key wrong in my explanation. The Master
>> (Parent) table does have the field ALLOCID and the child table is indexed
>> on ALLOCID. I'm going to run the program under debug to verify that the
>> child index is active and that the index key is what I think it is.
>>
>> Is the oForm:Initialize() the correct place to establish the relation?
>> Once the relationship is set, is there any other methods that need to be
>> used to keep the two DBBrowse objects in synch?
>>
>> Thanks for your help,
>>
>> Gary
>>
>>
>>
>> "Ignacio Ortiz de Zúñiga" <NoName@xailer.com> wrote in message
>> news:48eb10f2$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>>> Gary,
>>>
>>> The foreign key is always in the master table and the index is on the
>>> child table. So, the field name should be a master table FIELD. The
>>> index expressión on the Child table must match with that master field.
>>>
>>> Regards,
>>>
>>> --
>>> Ignacio Ortiz de Zúñiga
>>> [Soporte Xailer]
>>> [Xailer support]
>>>
>>>
>>> "Gary S. Rogers" <g.s.rogers@att.net> escribió en el mensaje
>>> news:[email=48ea7c40@ozsrv2.ozlan.local...]48ea7c40@ozsrv2.ozlan.local...[/email]
>>>>I am trying to display two DBBrowse objects in a form with a
>>>>parent/child relationship between them.
>>>>
>>>> oDbfDataSetFeeGroups is the Parent.
>>>> oDbfDataSetGroupAllocations is the Child
>>>> The foreign key in the Child is field ALLOCID and the Child dbf is
>>>> indexed on that field. It is the only index for the child table.
>>>>
>>>> Here is what I put in the oForm:Initialize() event:
>>>>
>>>> ::oDbfDataSetFeeGroups:Select()
>>>> ::oDBfDataSetFeeGroups:SetRelation("Allocid" ,
>>>> ::oDbfDataSetGroupAllocations)
>>>>
>>>> ::oDbfDataSetFeeGroups:GoTop() // probably not needed
>>>> ::oDBBrowseFeeGroups:GoTop()
>>>> ::oDBBrowseFeeGroups:SetFocus()
>>>>
>>>> The Parent DBBrowse shows records, the Child DBBrowse object does not.
>>>> I have verified that I have sample data in the child dbf that matches
>>>> parent records.
>>>>
>>>> Why doesn't this work?
>>>> TIA,
>>>> Gary
>>>
>>>
>>
>
g.s.rogers
Mensajes: 202
Registrado: Dom Feb 17, 2008 3:35 am

oDataSet:SetRelation()

Mensaje por g.s.rogers »

Ok, let me work with this. There may simply be a problem with my dataset.
Thanks for the input!
Gary
"Ingo" <support@mandantwin.com> wrote in message
news:48eb8b77$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Gary,
>
> the FormInitialize method is the right place for that:
> 1. open both datasets (master and child)
> 2. set the indexorder (OrdSetFocus) of the child dataset to the tag which
> is indexed on ALLOCID
> 3. then set the relation by the way:
> oMasterDataset:SetRelation("ALLOCID",oChildDataset)
>
> Regards
>
> Ingo
>
> "Gary S. Rogers" <g.s.rogers@att.net> schrieb im Newsbeitrag
> news:48eb86a4$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>> Ignacio,
>>
>> I got my definition of foreign key wrong in my explanation. The Master
>> (Parent) table does have the field ALLOCID and the child table is indexed
>> on ALLOCID. I'm going to run the program under debug to verify that the
>> child index is active and that the index key is what I think it is.
>>
>> Is the oForm:Initialize() the correct place to establish the relation?
>> Once the relationship is set, is there any other methods that need to be
>> used to keep the two DBBrowse objects in synch?
>>
>> Thanks for your help,
>>
>> Gary
>>
>>
>>
>> "Ignacio Ortiz de Zúñiga" <NoName@xailer.com> wrote in message
>> news:48eb10f2$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>>> Gary,
>>>
>>> The foreign key is always in the master table and the index is on the
>>> child table. So, the field name should be a master table FIELD. The
>>> index expressión on the Child table must match with that master field.
>>>
>>> Regards,
>>>
>>> --
>>> Ignacio Ortiz de Zúñiga
>>> [Soporte Xailer]
>>> [Xailer support]
>>>
>>>
>>> "Gary S. Rogers" <g.s.rogers@att.net> escribió en el mensaje
>>> news:[email=48ea7c40@ozsrv2.ozlan.local...]48ea7c40@ozsrv2.ozlan.local...[/email]
>>>>I am trying to display two DBBrowse objects in a form with a
>>>>parent/child relationship between them.
>>>>
>>>> oDbfDataSetFeeGroups is the Parent.
>>>> oDbfDataSetGroupAllocations is the Child
>>>> The foreign key in the Child is field ALLOCID and the Child dbf is
>>>> indexed on that field. It is the only index for the child table.
>>>>
>>>> Here is what I put in the oForm:Initialize() event:
>>>>
>>>> ::oDbfDataSetFeeGroups:Select()
>>>> ::oDBfDataSetFeeGroups:SetRelation("Allocid" ,
>>>> ::oDbfDataSetGroupAllocations)
>>>>
>>>> ::oDbfDataSetFeeGroups:GoTop() // probably not needed
>>>> ::oDBBrowseFeeGroups:GoTop()
>>>> ::oDBBrowseFeeGroups:SetFocus()
>>>>
>>>> The Parent DBBrowse shows records, the Child DBBrowse object does not.
>>>> I have verified that I have sample data in the child dbf that matches
>>>> parent records.
>>>>
>>>> Why doesn't this work?
>>>> TIA,
>>>> Gary
>>>
>>>
>>
>
g.s.rogers
Mensajes: 202
Registrado: Dom Feb 17, 2008 3:35 am

oDataSet:SetRelation()

Mensaje por g.s.rogers »

I have it working now. I needed to put a oDBBrowse:Refresh() for the child
browse object in the OnChange event of the parent browse object.
I really appreciate the help you guys give as a newcomer tries to learn this
stuff! I know I am making beginner mistakes.
Gary
"Gary S. Rogers" <g.s.rogers@att.net> wrote in message
news:[email=48ea7c40@ozsrv2.ozlan.local...]48ea7c40@ozsrv2.ozlan.local...[/email]
>I am trying to display two DBBrowse objects in a form with a parent/child
>relationship between them.
>
> oDbfDataSetFeeGroups is the Parent.
> oDbfDataSetGroupAllocations is the Child
> The foreign key in the Child is field ALLOCID and the Child dbf is indexed
> on that field. It is the only index for the child table.
>
> Here is what I put in the oForm:Initialize() event:
>
> ::oDbfDataSetFeeGroups:Select()
> ::oDBfDataSetFeeGroups:SetRelation("Allocid" ,
> ::oDbfDataSetGroupAllocations)
>
> ::oDbfDataSetFeeGroups:GoTop() // probably not needed
> ::oDBBrowseFeeGroups:GoTop()
> ::oDBBrowseFeeGroups:SetFocus()
>
> The Parent DBBrowse shows records, the Child DBBrowse object does not. I
> have verified that I have sample data in the child dbf that matches parent
> records.
>
> Why doesn't this work?
> TIA,
> Gary
g.s.rogers
Mensajes: 202
Registrado: Dom Feb 17, 2008 3:35 am

oDataSet:SetRelation()

Mensaje por g.s.rogers »

I have it working now. I needed to put a oDBBrowse:Refresh() for the child
browse object in the OnChange event of the parent browse object.
I really appreciate the help you guys give as a newcomer tries to learn this
stuff! I know I am making beginner mistakes.
Gary
"Gary S. Rogers" <g.s.rogers@att.net> wrote in message
news:[email=48ea7c40@ozsrv2.ozlan.local...]48ea7c40@ozsrv2.ozlan.local...[/email]
>I am trying to display two DBBrowse objects in a form with a parent/child
>relationship between them.
>
> oDbfDataSetFeeGroups is the Parent.
> oDbfDataSetGroupAllocations is the Child
> The foreign key in the Child is field ALLOCID and the Child dbf is indexed
> on that field. It is the only index for the child table.
>
> Here is what I put in the oForm:Initialize() event:
>
> ::oDbfDataSetFeeGroups:Select()
> ::oDBfDataSetFeeGroups:SetRelation("Allocid" ,
> ::oDbfDataSetGroupAllocations)
>
> ::oDbfDataSetFeeGroups:GoTop() // probably not needed
> ::oDBBrowseFeeGroups:GoTop()
> ::oDBBrowseFeeGroups:SetFocus()
>
> The Parent DBBrowse shows records, the Child DBBrowse object does not. I
> have verified that I have sample data in the child dbf that matches parent
> records.
>
> Why doesn't this work?
> TIA,
> Gary
Responder