Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Retrieving all caption properties of fields in a table
Message
From
23/04/2004 11:27:00
Dave Nantais
Light speed database solutions
Ontario, Canada
 
 
To
22/04/2004 17:21:25
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00897369
Message ID:
00897633
Views:
15
and I'll use the AFIELDS command to obtain an array of fields in the table.

m.lnx = AFIELDS(m.laFieldArray,'customer')


FOR lni = 1 TO m.lnx

m.lcCaption = DBGETPROP(
"customer." + m.laFieldArray[1,m.lni],
"Field",
"Caption")

m.BuildArray[1,lni] = m.laFieldArray[1,m.lni]
m.BuildArray[2,lni] = m.lcCaption[2,m.lni]

ENDFOR

then I end up with the 2 'parallel arrays' I was looking for....

thanks for 'breaking the back' of this problem...

>Dave
>
>Try DBGETPROP("customer.cust_id", "Field", "Caption")
>
>
>>>using
>>>
>>>SELECT Customer
>>>SCATTER TO m.laMyArray
>>>
>>>I obtain an array containing all fields of the customer table.
>>>
>>>Can I construct an array parallel to this one containing the caption property of each field?
>>>
>>>I must be able to do this inside a .prg file I cannot have this code working inside a Form or a Form's DataEnvironment.
>>
>>The only `technique` I can think of is opening the database container as a table ;
>>and doing
>>
>>USE C:\TEMP\CustomerDAtabase.dbc IN 0 ALIAS CustomerDatabase
>>
>>SELECT objectname , property
>>FROM CustomerDatabase
>>INTO CURSOR TestWork
>>WHERE ParentID = 51
>>
>>then i could scan through this cursor and parse through the property memo field to obtain the Caption information... but this method sucks :)
>>
>>anyone have any better suggestions?
Previous
Reply
Map
View

Click here to load this message in the networking platform