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?