Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Primary key in 2.6

Status
Not open for further replies.

jaapvanbeusekom

Technical User
May 3, 2010
2
NL
I search a way to create a primary key in a Foxpro 2.6 DOS database.

Of course I Googled but all results are for VFP not FPD 2.6.
Like ALTER TABLE customer ADD PRIMARY KEY cust_id TAG cust_id
does not work.

I need the primary key for synchronize with a other program/database

Please help!


 
Older versions of Foxpro didn't really differentiate primary or candidate keys. There is UNIQUE clause which will only display one value of duplicated keys.

One way or the other though, you have to create indexes manually or progamatically using the following syntax, not by using ALTER TABLE commands:
Code:
USE SomeDBF EXCLUSIVE 
INDEX ON somefield TAG sometag [UNIQUE]

-or-

INDEX ON field1 + field2 ... TAG sometag


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top