Yes that is the correct way to do it. You could create a simple view using the view designer and setting those fields as the key fields. Then DO HOME() + 'tools\gendbc\gendbc' to generate a PRG file that contains all the code needed to recreate the DBC, tables and views. You can then MODI COMM the PRG file to see all the code generated for that view.
>I need to create a view on a table which does not have a unique field.
>
>The records are identified by two fields, I cannot change that.
>So I would need to define two fields as key fields.
>DBSETPROP("VRegel.Werknummer","FIELD","KeyField",.T.)
>DBSETPROP("VRegel.Regel","FIELD","KeyField",.T.)
>
>Does this work? Werknummer is not unique, and Regel is not unique, but both together are a unique combination always.
Mark McCasland
Midlothian, TX USA