Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Modify table by program
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00507805
Message ID:
00507819
Vues:
8
Hi!

I will show you both is a single run ;)


Use MyTable in 0
if fsize("SomeField")<30 && field size is zero (d not exist) or less than 30
Use MyTable in "MyTable" EXCLUSIVE && exclusive use is required fro table structure altering
if fsize("SomeField") = 0 && field do not exist
ALTER TABLE MyTable ADD COLUMN SomeField C(30)
else
ALTER TABLE MyTable ALTER COLUMN SomeField C(30)
endif
endif


HTH.

>I have distribuited an aplication with some tables
> Now I updated my .exe and will send it to my client.
>
> There's a problem: Some fields of client's table are
> too short or do not exist.
>
> How can I build a little code to proceed to changes as below:
>
> Change 1
> If field1 size is < than 30
> Then icrease it's size to 50
>
> Change 2
> If field2 does not existe
> Then create field2
>
>
> Thanks
>
> Moisés
>
>
>
>
>
>
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform