>Hi there!
>
>I'm deploying a patch to modify an existing application so my users will be able to choose themselves to "primary" key for a record instead of having the app select the first one sequentially available. (dont ask why...)
>
>My original DB had a primary index on that key, so I drop it, then create a new one transparently like so:
>
>
>LOCAL leDropPK as Exception
>ALTER table tblGroupes drop PRIMARY key
>USE tblGroupes EXCLUSIVE
>SELECT tblgroupes
>INDEX on id_grp TAG id_grp ascending
>REINDEX
>USE
>
>
>Problem is, when I try that bit in the code window in VFP development environnement, it works fine, but when I use the same code in my app, it creates a "candidate" key instead of a "regular" one...
>
>Any idea why that is?
Sorry for the unrelated comment, but it looks like the USE exclusive is in the wrong place. It should be before ALTER TABLE.
If it's not broken, fix it until it is.
My Blog