Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add-Edit-Delete, best way
Message
 
 
To
30/09/1997 20:48:55
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00052551
Message ID:
00052631
Views:
28
>Like to have some advise on the best way to handle table maintenance
>in a Network environment.
>1) Having the ControlSource assigned to each field, when doing a ADD
> with APPEND BLANK 'might??' cause problem if another user activated
> the same(ADD function) in a network.
>2) Is it good to use record buffering? Pessimistic or Optimistic?
>3) Is record locking handled automatically by VFP 3.0 when
> APPEND BLANK and REPLACE commands is issued.
> If so, when will it be released(unlocked record)?
>
>Pls advise (I'm quite confused on finding the best way to handle).
>Cheers
>
>______________________________________________________
>Get Your Private, Free Email at http://www.hotmail.com

I prefer (when adding a record) to use an entry form where all data fields are empty. When user 'accepts' or hits a 'save' button, I execute code to generate a primary key for the new record, put all the date fields into an array, then do a SQL - INSERT. This prevents problem of primary key violations, blank records, still allows other users to be editing current records during the 'add record' process, etc. VFP handles the automatic locking then unlocks the table header.

Insert into MyTable from array MyArray

I also prefer optimistic row buffering and do a tableupdate() or tablerevert() on that row only depending on how the user 'exited' that row or form. I avoid table locking as much as possible because this prevents other users from editing individual records at the same time.
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform