Author: Rafael Copquin
Posted: 2011-10-11 at 12:07:10
It is a better way of doing things, to do your CA's in code and not in
the DE. You have greater control, especially if your select statement
involves more than one table. If you use the DE CA you would have to
change the select statement manually, because the wizard can only create
a select of just one table efficiently ( I mean, adding the joins properly)
Another thing you might consider, is not to use relations at all but sql
select statements to get the child table, based on the primary key of
the father table that has a correspondence in the child table as a
foreign key. IOW, get the primary key of the record in the father table,
then issue a select statement to get the child records based on that key
which should be the foreign key in the child.
ie nPK = fathertable.pkfield
select * from childtable where foreingkeyfield = nPK
So every time you refresh your CA (you can use requery(), just like a
view ), get the PK of the record you just obtained, and use a select
statement as above to get your child records.
BTW, your child could be another CA or just a non-CA cursor, as you
explained
The other thing that comes to mind is that the only way I find CA's
benefitial in a situation as the one you describe is when you need to
update the underlying table, otherwise, simple SPT statements would do
just fine.
Rafael Copquin
El 11/10/2011 12:41, Dave Crozier escribió:
> Not having used cursor adapters very much and wanting to try them as a short cut to make the conversion of a suite of programs into "Client server" I have the following Question.
>
> I have a parent table which I can pick up in the cursoradapter modifying the "SelectCmd property and then issuing a CursorFill method no problem, the parent table refreshes itself OK and reflecs this in the form.
>
> However, when I add a child table that is NOT a cursor adapter but a VFP table and then set up the relationship in the DE as you would with standard VFP tables using a dragged link between the parent and child, then when I "Refill" the parent table, the child doesn't reposition itself as per the relationship. Its just as though the relationship needs to be refreshed, but you can't refresh a relationship!!!
>
>
> Any Ideas.... this is driving me mad and I wish I'd stayed with SPT throughout, but using adapters would save so much recoding...
>
>
> Dave C
>
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/4E9469AE.5080300@fibertel.com.ar
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.