Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to 'Add' a record?
Message
De
18/12/2000 13:57:44
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
How to 'Add' a record?
Divers
Thread ID:
00454759
Message ID:
00454759
Vues:
84
VFP 6.0

I have the VFP settings in Options...
-Locking and buffering
-Multiple record locks
-Buffering: Record (Optimistic)

I believe I did set that, and then this morning, I checked it and it was changed? Anyway, I clicked 'Set as Default'.

Now, I like to know what is the best way to take advantage of the optimistic record buffering? This is what I have coded in the 'Add' button (Click Event):

SELECT person
LOCATE FOR DELETED()
IF NOT EOF()
REPLACE id WITH ''
RECALL
SCATTER
ELSE
APPEND BLANK IN person
ENDIF
ThisForm.REFRESH

and this isn't correct, but this is how far I got. I want to be able to have the user input the data on the form (with a grid) and then click 'Save' (then save the record) or 'Delete' (clear the form or actually delete a record). FWIW, this is what I have in the 'Delete' button (Click Event):

nAnswer = MessageBox('Do you want to delete this record?',4)
IF nAnswer = 6
DELETE
SKIP -1
IF BOF()
LOCATE
ELSE
SKIP
IF EOF()
SKIP -1
ENDIF
ENDIF
ENDIF
ThisForm.REFRESH

and I have not gotten the 'Edit' button yet (and the whole form is still enabled, as of now)... One thing I must inform now is that there is a Primary key in the table, so it must be uniqueness (otherwise error violation)...

Chuck
Today is tomorrow's yesterday.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform