>I was wondering how to share tables over a network. How do you allow two users to open the same table at the same time? I used SET EXCLUSIVE OFF in my main.prg for my project, but that doesn't work.
>
>I also thought that SET DELETED ON ignores the deleted records in a table. But if I delete a record and try to add another record with the same ID or on a table that has an autoincrement field it gives me a unique index violation error.I get rid of it by packing the table but I thought thats why I use the SET DELETED command.
>
>What am I doing wrong with these two areas? Thanks in advance,
>
>Tyler
Hi Tyler,
In first case SET EXCLUSIVE is scoped to the current data session, so setting it only in MAIN.PRG is not enough. You have to set it again in form.Load() or Dataenvironment.BeforeOpenTables() event.
In second case SET DELETED ( aso sscoped to the current datasession, BTW) does not affect handling the unique indexes. The record still stays in the table (until you PACK it) and violates uniqueness. Yo better use the generated and truly unique surrogate key for your Primary index.
Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison