Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DBGETPROP malfunction?
Message
From
29/01/2017 02:44:51
 
 
To
29/01/2017 01:45:21
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01647100
Message ID:
01647102
Views:
71
>Hi,
>
>I have troubles with DBGETPROP function to get the caption:
>
>
>CREATE DATABASE test
>CREATE TABLE testtable (field1 c(10), field2 c(10))
>DBSETPROP('Testtable','Field','Caption','My Long Caption')
>? the caption is '+ DBGETPROP('testtable.field2','Field','Caption')
>
>
>errors "command contains unrecognized phrase / keyword" on row 4
>
>What is possibly going on here?
>
>Regards,
>Koen

Slow Sunday morning, is it?

For the error you're reporting, you're just missing a tick to start the "the caption is " string.

But, for what you're intending to do, an error will pop up in the row (ahem, line...) 3. When you're referring to a field property, you must fully specify the field, otherwise VFP won't have a clue on your intentions, as you did - correctly - in the GET function.
CREATE DATABASE test
CREATE TABLE testtable (field1 c(10), field2 c(10))
DBSETPROP('Testtable.field2','Field','Caption','My Long Caption')  && didn't specify the field, 
? 'the caption is '+ DBGETPROP('testtable.field2','Field','Caption')   && properly formed string
----------------------------------
António Tavares Lopes
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform