Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Uniqueness of index PRIMARY is violated
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00144393
Message ID:
00146423
Views:
39
Richard,

I have tried to find the VFP reserved/restricted words list in the online help (index) for VFP 6, but I came up dry. I'm sure it's in there somewhere, but under some 'title' which I do not 'intuit' to!

My concern is that you may well have some other reserved word in use. When I see things like "filename' i get worried about that.

In any case, I wish you luck.

>>Jim,
>>
>>>I'll be happy to tell you: DO NOT USE ANY VFP RESERVED WORDS AS NAMES ANYWHERE IN YOUR CODE!
>>
>>I've been naming my primary index PRIMARY since I can rememeber and I've never had a single problem doing so.
>>
>>I've done things like SET ORDER TO PRIMARY and INDEX ON accountid TAG PRIMARY without suffering any consequences. Although I can see your point, maybe a better tag name would be PRIMARYKEY or something.
>------------------
>
>Ok guys,
>I went off and did a few other things for a while. Now I'm back to this. I've just re-read the entire thread. It's really been interesting.
>
>Here's what I did...
>...I changed the PRIMARY tag name to PrimaryKey
>...I updated all my affected views (no forms or reports are involved),
>...and I rebuilt my project.
>
>Here what happened...
>...Same stuff
>...it made no difference.
>
>Is there a limit on the length of a tags definition?...or resulting string?
>
>
>I now have an index named PrimaryKey, which is my primary index.
>I get the message when I'm trying to INSERT records into my table...
>MergeList.dbf
> FileName (Character 200)
> Source (Character 30)
> Received (DATETIME)
>
>My primary index, "PrimaryKey", is defined as:
>LEFT(ALLTRIM(filename),RAT("\",ALLTRIM(filename)))+RIGHT(ALLTRIM(filename),11)+SUBSTR(ALLTRIM(filename),RAT("\",ALLTRIM(filename))+1,1)
>
>The reason I'm doing this is becuase my file names belong in pairs and this way I can display them as pairs.
>
>Basically, it takes file names like
> \DEVELOP\OFAX2\data\date\October061998\C1001012.TXT
> \DEVELOP\OFAX2\data\date\October061998\R1001012.TXT
>
>and turns them into
> \DEVELOP\OFAX2\data\date\October061998\1001012.TXTC
> \DEVELOP\OFAX2\data\date\October061998\1001012.TXTR
>
>What I don't understand is why I'm getting this message. I can insert the first record fine (of course), but as I continue I get this message and what I'm inserting is new, unique information.
>
>Here's my code:
>* get a list of the C*.txt and R*.txt files in the cSourceDirectory
>* add these to the MergeList table with Source = "FDLE"
>* and received = today's date and time
>* cBaseDirectory is the starting directory of my app
>* cSourceDirectory is "Download" ....not that it really matters for this question.
>* I've tried this with the Table and with this updateable view
>* the view is the same as the table...all fields updatable...key is FileName
>*
>IF adir(aDir_Info, cBaseDirectory+"data\"+cSourceDirectory+"\*.txt") > 0
> FOR nRow = 1 to ALEN( aDir_Info, 1)
> INSERT INTO vMergeList2 ;
> (FileName, ;
> Source, ;
> Received) ;
> VALUES ;
> (cBaseDirectory+"data\date\"+cDestinationDirectory +"\"+ aDir_Info[ nRow, 1], ;
> cSupplier, ;
> DATETIME())
> ENDFOR
>ENDIF
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform