Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding Fields To Tables
Message
De
30/10/2002 15:14:08
 
 
À
29/10/2002 01:29:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00716324
Message ID:
00717075
Vues:
16
I use an external routine (FXP) to perform specialized functions such as these.

For example UpdatePerform.fxp. Your application, upon startup, will recognize the existance of the fxp and run it. Once complete, your application should delete the UpdatePerform.fxp.

The UpdatePerform.fxp will perform special "One-time" functions against the database. For instance, I never did like people with the lastname of "Jones", rename them all to "Smith". :-)


In your case:

1. It would open the selected table.
2. Use FSIZE() to determine if the field already exists
3. If it does not exist use ALTER TABLE to add the or change columns.
4. Delete any old indices that should not be there and add new ones.


In our apps, the existance of updateperform.fxp triggers an automatic process which will get exclusive access to the database container and call the validate database and reindex processes. One of these processes is to also compare the data dictionary to the existing tables and adjust when necessary.
Gordon de Rouyan
DC&G Consulting
Edmonton, Alberta
Email: derouyag@shaw.ca
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform