Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine tables that have a certain field?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01314228
Message ID:
01314292
Views:
7
This message has been marked as a message which has helped to the initial question of the thread.
>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
Luis María Guayán
Tucumán, Argentina
________________________________
SysOp de www.PortalFox.com
Nada corre como un zorro
________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform