Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why can't DBGETPROP give me the datatype of a field?
Message
From
02/12/1998 12:41:11
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00163275
Message ID:
00163280
Views:
19
Hi Joe.

>The documentation says that DBGETPROP can get the 'DataType' of a field in a view, but NOT the 'DataType' of a field in a table.
>
>I know the TYPE function will give me the raw type ('C', 'N', 'D', etc...), but I want the complete data type: 'C10', 'N7,2'

DBGETPROP doesn't return the data type for a field because no structural information about tables (other than a list of field names) is stored in the DBC.

You have two choices:

- If the table is open or can be opened, use AFIELDS to create an array of structural information for each field

- You can use DBCX (a public domain data dictionary extension manager) to keep meta data information for your tables. Without opening the table, you can use code like:

oMeta.DBCXGetProp('table.field', 'Field', 'Type')

to get the data type.

Doug
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform