Here is an example of the problems I am having with the record pointers.
First make a table named 'Table_A' with one column named 'Col_A' containing the following info in this order:
A_1, B_2, C_3, D_4, E_5
Then make another table named 'Table_B' with two columns named 'Col_A' and 'Col_B' and populate them with this info in this order:
A_1, AA_11
B_2, BB_22
C_3, CC_33
C_3, CC_44
C_3, CC_55
D_4, DD_66
E_5, EE_77
In command window:
SELECT Table_B
INDEX ON Col_B TAG Col_B ADDITIVE
SELECT Table_A
INDEX ON Col_A TAG Col_A ADDITIVE
SET RELATION TO Col_A INTO Table_B ADDITIVE
SET SKIP TO Table_A
SELECT Table_B
BROWSE LAST
SELECT Table_A
BROWSE LAST
Now alternating focus between command window and Table_A, do the following:
SKIP
Focus Table_A and note position of record pointer
Repeat to end of table. Note that the record pointer moves to the correct record and remains there every time.
Now repeat the process using SKIP -1. Note that when record pointer moves from E_5 to D_5, C_3 to B_2, and B_2 to A_1 the record pointer moves to the correct record and remains there. However, when you move from D_4 to C_3, the record pointer moves to C_3, CC_55 correctly, then jumps to C_3, CC_33 and remains there. It does NOT remain on the correct record (C_3, CC_55) NOR does it EVER go to C_3, CC_44.
I am having this exact same issue within my programs and it is driving me batty. I can move the record pointer to a record and load the correct record set. But, when I edit that record set and save it, the edited record OVERWRITES a different record. Needless to say, that destroys the underlying record and gives me two similar records, one correct and one incorrect. Short of tracking the record numbers myself, or setting up a master cursor with all currently needed table data in it, I don't know what to do about this.
Tracking the record numbers myself seems simple enough at the moment, although there might be some issues with doing it myself that I am currently not aware of.
Using a flat file type cursor seems like a lot of extra coding to handle data changes to/from the underlying tables. And since there are potentially millions of combinations between the four tables of data being used, the cursor could get quite large and create other issues. Currently those four tables have 5066, 4928, 5755, & 13888 records in them, but all will easily top 1 million each eventually, so it would seem to me that the cursor idea would eventually crash.
So what can I do about this? What are my best long-term options?
mmerlinn
"Political correctness is the BADGE of a COWARD!"