Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Columns
Message
De
28/10/2002 15:22:20
 
 
À
28/10/2002 15:02:30
Billy Bramhall
Interdirect Usa, Inc.
Houston, Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00716154
Message ID:
00716170
Vues:
26
This message has been marked as the solution to the initial question of the thread.
USE MyTable SHARED IN 0
FldsCnt = AFIELDS (aFlds, "MyTable")
FldExist = .F.

FOR I = 1 TO FldsCnt
   IF aFlds [I, 1] == "MYCOL"
      FldExist = .T.
      EXIT
   ENDIF
ENDFOR

IF NOT FldExist
   USE IN MyTable
   USE MyTable EXCLUSIVE IN 0
   ALTER TABLE MyTable ADD COLUMN MyCol C (20)
   USE IN MyTable
ENDIF
HTH

>I need code that will do the following:
>
>1. Check to see if a column (field) exists in a table.
> 1a. If the column does exist, then exit.
> 1b. If the column does NOT exist, then add the column to the table.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform