Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a Primary key.
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Creating a Primary key.
Miscellaneous
Thread ID:
00322044
Message ID:
00322044
Views:
67
I am trying to create a primary key for my table out of the following index called "keydex" :

custid+upsino+DTOS(puldat)+STR(sampleno,2)

however, it keeps telling me the "uniqueness of the index is violated." The field "sampleno" is the unique identifier for the records in the database. I know the sampleno does not exeed 2 digits and is incremented correctly by a value of 1 for each duplicate record. I am running the following code to determine which records are causing me problems:

function checkit
lparameters cDataTable
close tables
use (cDataTable) order keydex
go top
STORE SPACE(35) TO cCandidate
DO WHILE .NOT. EOF()
cCandidate=EVALUATE(SYS(14,4))
SKIP
IF EVALUATE(SYS(14,4))=cCandidate
BROWSE
ENDIF
ENDDO

The "keydex" is the 4th index tag in the table. The browse window never comes up, indicating to me that it never encounters a duplicate record based on the four fields in the index. So why is the index not unique?

Thank You
Elgin Rogers
Elgin Rogers
Epic Solutions
www.epicsolutions.net
Next
Reply
Map
View

Click here to load this message in the networking platform