Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing Table Structure - Field Comments
Message
From
28/12/2000 17:31:21
 
 
To
28/12/2000 16:32:45
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00457435
Message ID:
00457611
Views:
21
>Hi Trey,
>
>Thanks again. I guessed wrong because I couldn't find "CursorGet()" in the documentation.
>
>I guess it all works except the following:
>
>repl field_cmt with dbgetprop("tmain.lf_can."+allt(???????), "field","comment") all
>
>You don't by any chance know the field name of the field comments in a table structure do you? Or how to get it?
>

Seems we have another one :)
I'm assuming that lf_can is the table and tmain is the database. Correct?
The database should not be referenced in the dbgetprop() call. The currently selected database will be used for this.
In the table created by the COPY STRU EXTENDED command, there is a field called field_name which contains the field name.

Copy and paste the following code - call the COPY STRU EXTENDED target table whatever you like, I usually just tag "_stru" to the end of the table I'm copying the structure of. Note: I changed it up a bit to open the database first - that's a little cleaner, anyway.
open database tmain
use lf_can
copy structure extended to lf_can_stru
alter table lf_can_stru add column field_cmt c(254)
sele lf_can_stru
repl field_cmt with dbgetprop("lf_can."+allt(field_name), "field","comment") all
Also, I should point out that although you can use this altered structure table to create another table (using CREATE FROM) it won't pull in the field comments.
HTH
Insanity: Doing the same thing over and over and expecting different results.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform