Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Read / write cursors???
Message
De
06/11/1998 16:11:33
 
 
À
06/11/1998 16:07:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00155363
Message ID:
00155374
Vues:
24
>>>>>I want to ...
>>>>>
>>>>>- build a cursor containing a subset of the main table...
>>>>>- populate a grid from the cursor...
>>>>>- have the user make a change via a pop-up edit window...
>>>>>- save the change to the original main table...
>>>>>- have the grid (cursor) also reflect the change
>>>>>
>>>>>
>>>>>I'm sure that this is an 'every day' kind of thing, but there are so many ways to accomplish this... I'm looking for suggestions...
>>>>>
>>>>>Thanks
>>>>
>>>>You should have generic method which will get table records into cursor (SELECT or SEEK/SCAN) and use this cursor as grid.recordsource, actually nothing more. It's important that cursor will carry all primary key fields from the table.
>>>
>>>That's what I'm doing but I must not be doing it right...
>>>
>>>The cursor is the recordsource for the grid... when I pop-up the edit window, I'm displaying the record from the *main table*, not from the cursor. I did this because I'm not sure how to get changes from the cursor back to the main table...
>>>
>>>THanks
>>
>>If cursor holds primary key field(s), then you can always SEEK in table too.
>
>But I'm updating the main table already ( it's displayed in the edit window ) so I'd locate the record in the cursor and update is as well?
>
>Thanks

No, you may either call generic method (populating cursor) again, or just locate corresponding record in cursor and replace values there. However, normal way is going from buffer (cursor or view as Josh said) to table, i.e. you edit buffer values and then either replace values in table immediately ( or use view row buffering) or accumulate changes and move it to table as one transaction (or use view table buffering).
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform