Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to program testing the multiuser program?
Message
De
08/11/2003 19:16:58
 
 
À
04/11/2003 11:47:54
Michale Chen
Shijiazhuang ZhiYuan Crop.
Shijiazhuang, Chine
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00846038
Message ID:
00847995
Vues:
24
This message has been marked as the solution to the initial question of the thread.
Hi,
As mentioned by other members, you should use GETFLDSTATE() and GETNEXTMODIFIED() to detect changes on your own local buffered data. Then,
FOR I = 1 TO FCOUNT()
  lcField = FIELD(I)
  IF CURVAL(lcField) # OLDVAL(lcField)
    *--Conflict
    RETURN <ERROR>  
  ENDIF
NEXT

*-- No conflict, issue TABLEUPDATE()
IF NOT TABLEUPDATE(.T., .F.)
  AERROR(laError)
  DO CASE
  CASE laError[1] = 1585
     RETURN "CONFLICT"
  OTHERWISE
     RETURN "ERROR"
  ENDCASE
ELSE
  RETURN "OK"
ENDIF
IF, your meant is how to know your conflict handler routine works correctly? You can have two instances of VFP running at the same time in same machine, Locate same record and make changes in both instance. Then, issue TABLEUPDATE() on 1st instance, after that go to 2nd instance and issue TABLEUPDATE() again. You will found that TABLEUPDATE() return .F. with error code 1585 in 2nd instance.

HTH
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform