Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check for field name in table
Message
De
20/01/2011 10:17:41
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01496634
Message ID:
01496686
Vues:
90
Or, you could use FIELD()
SELECT 0
USE (cFile) 
IF Empty(Field('thh05'))
  USE
  Alter Table c:\db\past.DBF Rename Column thh05 To thh11
ENDIF
USE
>Not even close. You're checking for presence of string 'thh05' in the table name (including path). And comparing result of comparison with .F. is totally unnecessary. That what NOT is for
>
>SELECT 0
>USE (cFile) 
>IF TYPE(ALIAS() + '.' + thh05) <> "U" 
>  USE
>  Alter Table c:\db\past.DBF Rename Column thh05 To thh11
>ENDIF
>USE
>
>
>
>>sorry - i found solution in previous forum reply. I think Tore's help.
>>
>>cfile='c:\db\past.DBF' 
>>if 'thh05'$cfile = .F.
>>
>>k
>>etc
>>>what code could i use to verify if a field name is present in a table.
>>>
>>>Alter Table c:\db\past.DBF Rename Column thh05 To thh11
>>>
>>>
>>>this works fine however if the program is repeated thh05 is no longer present and an error message appears.
>>>
>>>i need an 'if' command to check for thh05
>>>
>>>thanks
>>>k
Jim Nelson
Newbury Park, CA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform