Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can SEEK() return .T. but have the wrong record?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00903416
Message ID:
00903435
Views:
12
>I'm working with a table that has two indices for it. One index is the primary index using a numeric field, LocID. Let's call this index LOCID.
>
>The second index is a composite equal to a combination of two fields, like so: STR(ParentID)+STR(ChildOrder). Call this index TREEORDER.
>

STR() return a lot of spaces, try to index with something like:
PADL(ALLTRIM(STR(ParentID)),10,"X")+PADL(ALLTRIM(STR(ChildOrder)),10,"X")
Of course, you have to search with the same padding :)


>This table is used to populate a TreeView control, where the ParentID is the LocID of the parent of this child node, and the ChildOrder is a number that is used to put the children of a node into the correct order.
>
>When I am populating the TreeView control, I SET ORDER TO TREEORDER.
>
>In any case, I'm working on a Drag&Drop function that allows me to move nodes around. At no time do I change the LocID of any record.
>
>What is odd, is that at times I can SET ORDER TO LOCID, and SEEK()for a certain value. The result is .T., and the record pointer is on the correct record. Later, I can do that same thing, SET ORDER TO LOCID, and do the same SEEK(). It again returns .T., but the record pointer is on Record #1, the wrong record!
>
>I don't see how this is possible if I never change the value of LocID for any records?
>
>This is driving me crazy. I would appreciate help!
>
>Thanks,
>Jim
If we exchange an apple, we both get an apple.
But if we exchange an idea, we both get 2 ideas, cool...


Gérald Santerre
Independant programmer - internet or intranet stuff - always looking for contracts big or small :)
http://www.siteintranet.qc.ca
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform