Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multiuser Application problem
Message
De
16/06/1999 13:58:01
 
 
À
16/06/1999 13:51:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00230531
Message ID:
00230538
Vues:
20
IMHO, the best way would be to write an INSERT and an UPDATE trigger in the DBC that will do the validation. You will only need to verify the return value of TableUpdate() in your app and display an appropriate message if it return false.

HTH

>Please help me solve following situation in multiuser application.
>
>I have a two date fields in one of my table in database.
>
>Start date AND Stop Date.
>
>Whenever I enter start date and stop date for new record. This start and stop should not overlap
>with the dates of records which are already there in database.
>
>for example, i have following entries in database.
>
>start date stop date
>06/14/99 06/20/99
>06/22/99 06/25/99
>
>now, for any new record , user can't enter start/stop date like 06/15/99 - 06/21/99 because it
>overlaps the exsisting records.
>
>That's why before saving any record, I check this validation by Select-sql on the database.This
>works fine.
>
>The problem is in multiuser situation. for example two users are entering new records at same time.
>both have entered same start/stop date. let's say 06/27/99 - 06/30/99.
>
>when User A goes to save this record, validation will check that is this range overlaps with any
>previous records? He will not get any previous records with this range because User B has not
>saved the changes yet. so He is allowed to save this record.
>
>This is ok. but By the time User A gets the results of his query and he saves the record. User B saves the record.
>so now, User A and User B both are allowed to save and database have duplicate entries.
>
>I coudn't think what's the solution of this. I don't think I should user locking file mechanisam.
>
>Please advise what's the solution of this situation.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform