Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why DBGETPROP instead of KEY() ?
Message
From
11/10/2001 16:03:10
Robert Jewett
Q Technology Consulting
Tyler, Texas, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Title:
Why DBGETPROP instead of KEY() ?
Miscellaneous
Thread ID:
00567201
Message ID:
00567201
Views:
43
For some reason (phase of moon, different lunch, whatever), I was using the UniqueIDSetup facility to set up a new table, and received an error that the name used for the index was not found. Poking into this, it appears that UniqueIDSetup expects the name of the Primary Key Index to be the same as the field name.

Given the expectation that one would be using unique key generation, I was curious why ' DBGETPROP(tcTable, 'Table', 'PrimaryKey') ' was used, instead of a simply Key() statement for the primary key. i.e., you could select the index returned by DBGETPROP to be certain it was the primary, and then use the KEY() function to get the name of the field.

I guess at the end of the day it is a matter of preference and habit, but was curious if there were other issues which I might have overlooked?
Reply
Map
View

Click here to load this message in the networking platform