Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data Sessions and open tables management
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00936969
Message ID:
00937118
Vues:
11
This message has been marked as a message which has helped to the initial question of the thread.
>We are considering creating some classes to manage data sessions and open tables throughout our app. Has this already been done by someone and is it available? We don't want to incorporate a framework because the app is 10 years old, was recently converted to VFP8 (mostly redone anyway for that). Due to converting the app from FPD26 to VFP8, in almost all cases, the tables are opened before the forms are instantiated and then closed after the form object is destroyed in prg files that call every form and open tables, set any required variables, etc. That is why incorporating a class for table management and data sessions would be a nice tool to implement. Any ideas anyone? Has it already been done?

Tracy,
We did the same thing a few years back updating from DOS to VFP 6 and created a class to start private data sessions as David says. I still feel that starting everything from a PRG gives you much more control and I love having all the procedures in a text file where I can see and print them.

One other thing we did was to was to write a PRG that does all the table updates. We create an array of tables to be updated in the calling prg and send it to the table update prg. This way all the code such as BEGIN TRANSACTION, END TRANSACTION, table reverts and error trapping with the associated user messages are done one time and not in each prg.

*
* Example with messages
* -----------------------------
* mmsg = 'The payments were lost due to file conflicts'
* Dimension aTables(3,2)
* aTables(1,1) = 'apinvc'
* aTables(1,2) = 0 && only one header rec to update
* aTables(2,1) = 'apinvcln'
* aTables(3,1) = 'appoln'
* if jTblUpdt(@aTables,mmsg)
* =MessageBox('All Payments were posted.', 64, 'Pay Invoices')
* endif
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform