Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create field
Message
De
27/11/2001 07:20:20
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00586205
Message ID:
00586221
Vues:
24
Moises,

Something like this should work:
SELECT < TableToCheck >
IF TYPE("< FieldToCheck >") = "U"
  *-- field doesn't exist
  ALTER TABLE < TableToCheck > ADD COLUMN < YourField > C(50)
ELSE
  *-- field exists, check the size
  IF FSIZE("< FieldToCheck >") <> 50
    *-- change size of field
    ALTER TABLE < TableToCheck > ALTER COLUMN < YourField > C(50)
  ELSE
    *-- all is fine
  ENDIF
ENDIF
HTH
>Please I need a little routine
>
> When start my program:
>
> Check if a field exists
> If it does not exist, creates that field
>
> If the field exists check it's size
> If it has less the 50character, for e.g., change it to 50.
>
> TIA
Daniel
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform