Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting keyfields property for once and for all...
Message
 
To
06/01/2000 13:57:17
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00313962
Message ID:
00314233
Views:
50
Sorry, I should have included this earlier, but I was in a hurry.

Here are the commands to set the KeyField, Updateable, Update name and Datatype.

DBSetProp('V_USERS.usr_pk', 'Field', 'KeyField', .T.)
DBSetProp('V_USERS.usr_pk', 'Field', 'Updatable', .F.)
DBSetProp('V_USERS.usr_pk', 'Field', 'UpdateName', 'o3!users.usr_pk')
DBSetProp('V_USERS.usr_pk', 'Field', 'DataType', "C(5)")

The easiest way to understand this code is to run GenDBC (or GenDBCX for large databases). GenDBC is included with VFP and GenDBCX is in the files section here.

Both of them result in the program code to develop your DBC from the beginning. You can learn a LOT by looking at it.

One warning The resulting code defaults to a PRG file named the same as your database. One accidental doubleclick on it and your entire database is 'renewed'. With empty tables. I ALWAYS rename the file to a TXT file, and usually use the database name + the date to remind myself when I did it.

Barbara

>Thanks!
>
>Any idea what command will set it programmatically? Dbsetprop? Sqlsetprop?
Barbara Paltiel, Paltiel Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform