How to Create a Primary Index in a Visual FoxPro ProgramLast reviewed: April 30, 1996Article ID: Q130601 |
The information in this article applies to:
SUMMARYMicrosoft Visual FoxPro has a new index type, Primary. The Primary index, however, cannot be created in a program by using the INDEX command. This article shows by example how to add or modify a Primary index in a program.
MORE INFORMATIONA Primary index is an index that never permits duplicate values on the specified field or expression. The Primary index may be established in the database container interface or in a program by using the CREATE TABLE or ALTER TABLE command. A table with a Primary index must be part of a database and cannot be a free table. The first example shows how to create a table with a Primary index. The second example shows how to alter an existing table to change a Primary key. The third example adds a Primary index to an existing table.
Example 1 - Create a New Table with a Primary Index
Example 2 - Modify an Existing Table to change a Primary Index
Example 3 - Modify an Existing Table to add a Primary Index
|
Additional reference words: 3.00 VFoxWin
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |