Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
My Grid has no order though one is defined
Message
From
07/06/2007 09:54:54
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01230866
Message ID:
01231258
Views:
12
>>>Trouble is, the District list is in the correct DESC order but the Zones table is higgledy-piggledy order.
>>>
>>>Any ideas what's amiss?
>>
>>"DESC" as descending or description?
>>
>>And I'm not quite sure what do you mean by master-child here... do you mean the grids' recordsources are zones and districts respectively, and you got the county related into each (additive)? And if so, related via what field?
>
>Thank you (the only one who's answered)
>
>As I said, the DESC (Description) field of each table (not my table design)
>
>Belay what I said aboutn reversing the master [parent] - child order. I though I had but hadn't.
>
>Grid 1 has:
>- recordsource = ZONES
>- LinkMaster = COUNTY
>- ChildOrder = County (FK to COUNTY.Code - PK)
>- RelationalExpre = Code
>and if we look at the reln. arc's props in the DE:
>- ChildAlias = ZONE
>- ChildOrder = County
>- ParentAlias = COUNTY
>- RelationalExpre = Code
>
>Grid 2 has:
>- recordsource = DISTRICT
>- LinkMaster = COUNTY
>- ChildOrder = County (FK to COUNTY.Code - PK)
>- RelationalExpre = Code
>and if we look at the reln. arc's props in the DE:
>- ChildAlias = DISTRICT
>- ChildOrder = County
>- ParentAlias = COUNTY
>- RelationalExpre = Code
>
>So they both have similar key names and same relnship with COUNTY table. I have them both ordered on their DESC fields, so the descs appear in the grid in alphbetical order. Now this works (or seems to - maybe just luck) for the DISTRICT table but the ZONES table appears in random order, but the underlying table in the DE shows them to be in County (FK) order.
>
>Now I realise this is the ChildOrder, but when I set the Order prop, in the DE, to DESC I assumed the table would display in that order but I find the County FK is overriding.
>
>Maybe I'll have to make a composite key of County+Desc, but that won't have a matching parent index in the COUNTY table./
>
>IOW I want to display all the ZONEs for a particular COUNTY, but I want those zones in the grid, in their DESCription field order. I think it IS just luck that the DISTRICT table is in the right order.

You just can't have it ordered by Desc if they are ordered by county. The one table that looks right was maybe just accidentally populated in that order - try to add some district or zone starting with a B and my guess is it would go to bottom.

The composite key is your way out, or using cursors (with so-called safe select - and if the grids are editable, some code for write-back into the source tables), or parametrized views. And the composite key will work, unless you have Set Exact On - i.e. seek("008") will find a record whose county+desc="008Knockshire"

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform