Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ideas for passing records back to calling form
Message
De
16/09/2015 21:53:00
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
16/09/2015 17:19:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01624724
Message ID:
01624733
Vues:
96
>Hi all,
>
>Funny it seems I have never had to do this before so soliciting ideas...
>
>One form calls another form to allow the user to pick a few records to insert on the calling form (e.g. half a dozen rows, perhaps 5 fields each). I originally wrote this to have the user pick the records and then before the form closed, I would insert these rows into the underlying table and close the form. Then on the calling form, I would requery the view that displayed these records. But this view is also updatable to I also needed to write out any changes in the original view before requerying. This then seemed "wrong" because the user has a cancel button on that form - if they at that point pressed Cancel, all changes would be dumped *except* for the changes in the view that I had just written out. (I should note that the called form uses a different data session).
>
>So then I thought I had better only make changes to the original view by instead passing back any rows to be inserted and inserting these into the original view.
>
>I know that I can pass back an object from the called form as it's return value (and that object can contain an array of the rows to be inserted) but I am wondering if others routinely do something else? I guess I could pass back an XML string and create a new cursor out of that.
>
>Any other nice ways to pass data back (and while we are at it, passing data forward). Is there any way to pass a data session back and forth?
>
>Thanks,
>Albert

I see several ways.

- put the forms in same datasession, return alias
- return the data as array, rebuild the table
- return the data as a string, for example as XML, rebuild from that, a csv string, or a string to a temp csv file will do as well.
- create a temporary (free) table not a cursor, a real table on your temp drive, return the path, open in calling form, read data delete table.

I use the temp table thing for a kind of general filter that is available to every form. For anything else I use same datasession.

HTH
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform