Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can SEEK() return .T. but have the wrong record?
Message
From
12/05/2004 18:41:49
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00903416
Message ID:
00903421
Views:
19
>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.
>
>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?

If you use all 3 arguments in your SEEK() (rather than using separate SET ORDER etc.) do you see the same problem? If it's a problem with your code we really need to see the exact code to be able to help.

Another possibility is a corrupted index. You could try re-creating them from scratch (rather than REINDEX).
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Reply
Map
View

Click here to load this message in the networking platform