Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
? return caption with dbgetprop()
Message
 
To
19/03/2002 13:49:35
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00634577
Message ID:
00634589
Views:
17
>I need to return the caption of a field in a database. However, I need to do this on the fly at runtime. Given variables for the database and table name.
>My table name and database will be changing.
>
>I have tried:
>? dbgetprop(dbc()+'.'+field(1,alias()),"Field","Caption")
>
>but this returns a data type mismatch error.
>
>The field() function returns a numberic because my first field value is a number.
>
>The dbc() function returns a datatype of undefined U
>
>I've experimented with macro substitution and evaluate() but have had no luck.
>
>I think what is happening is it is returning the character string and then immediately evaluating it as a variable.
>Thanks

This seems to work
lcField=Alias()+"."+Field(1, Alias())
?lcField
?DBGetProp(lcField,"FIELD","Caption")
Caroline
Previous
Reply
Map
View

Click here to load this message in the networking platform