Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I see the table that makes the table?
Message
From
08/05/2001 22:23:45
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00505091
Message ID:
00505097
Views:
26
Hi Brenda,

Have a look at ADIR() & AFIELDS() in the online help.

Try something like this:
cMyPath = "c:\mypath\"

=ADIR(aMyDBFs,cMyPath + "*.dbf")

FOR nLoop1 = 1 TO ALEN(aMyDBFS,1)
    * ----- Loop through the DBFs
    USE (cMyPath + aMyDBFS[nLoop1,1])
    * ----- Get an array of DBF fields
    =AFIELDS(aMyFields)
    FOR nLoop2 = 1 TO ALEN(aMyFields,1)
	* ----- Loop through the fields Array
	cFieldName     = aMyFields[nLoop2,1]
	cFieldType     = aMyFields[nLoop2,2]
	nFieldLength   = aMyFields[nLoop2,3]
	nFieldDecimals = aMyFields[nLoop2,4]
    ENDFOR
ENDFOR
Hope this helps,
Gavin.

>I have a need to read a folder of free tables (*.dbf) and pull off each of the table name, field names, and field definition. How can i read in a program the table definition?
>
>Thanks
>
>Brenda
Previous
Reply
Map
View

Click here to load this message in the networking platform