Information générale
Catégorie:
Codage, syntaxe et commandes
>>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
I also generate a unique key for the primary index...but with "candidate" indexs I use a filter of .not.deleted().
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement