Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting keyfields property for once and for all...
Message
 
À
06/01/2000 13:57:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00313962
Message ID:
00314233
Vues:
48
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform