Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determine tables that have a certain field?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01314228
Message ID:
01314373
Vues:
10
>>Is there a command/function that will tell me what tables in a database have a certain field (e.g. "MYFLD")?
>>
>>Thank you in advance for your help.
>
>
>OPEN DATABASE (HOME(2) + "NORTHWIND\NORTHWIND.DBC")
>lcFieldName = "City"
>lnTables = ADBOBJECTS(laTables, "TABLE")
>FOR lnI = 1 TO lnTables
>  USE (HOME(2) + "NORTHWIND\" + laTables(lnI)) ALIAS "Tmp"
>  lnFields = AFIELDS(laFields, "Tmp")
>  IF ASCAN(laFields,lcFieldName,1,ALEN(laFields,1),1,9) > 0
>    ? DBF("Tmp")
>  ENDIF
>ENDFOR
>
Thank you, Luis.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform