Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Validation Class
Message
 
 
À
18/06/2002 14:53:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00669859
Message ID:
00669862
Vues:
19
Pass form's DataSessionID as a parameter to each class method. Use SET DATASESSION TO tnPassedID (Save it first in class property, then restore). It's not an ideal solution, but there is probably no better one.

We use this approach in our system. We have two applications: Update and Validation. Both are extremely complicated (I would say, over-complicated) and both are not mine (unfortunately), so I can not get you more info...

>I would really like to have a class for each table. The class would contain all the field-level rules, record-level rules, and trigger rules as methods of the class. Ideally the class would be instantiated once and stay open until the app is closed.
>
>I have 2 problems:
>
>1. After the class is instantiated in a datasession (DS), then any time one of the methods is called the DS changes to the DS that the class was created in. But the table is located in a different PrivateDS for a form, causing "file/field not found" errors.
>
>2. Having dbc_AfterOpenTable(cTableName) create the class object bogs down the entire app, because it runs evertime a "Select..." uses the table, and I have a lot of views like this "Select myUDF1(fk1), myUDF2(fk2)...." where myUDF does it's own select. So dbc_AfterOpenTable() is run during every pass through myUDF.
>
>Any ideas on how to implement this?
>
>TIA
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform