Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gather Memvar 2

Status
Not open for further replies.

DaBuzz

Programmer
Nov 8, 2002
40
US
I have a program where I open up a table scatter memvar, do data entry via a form and on the save button I gather memvar.
Works great.
Except - I had one person doing data entry and their PC errored out for one reason or another and they didn't get to shut down the application normally.
Mulitple records had updated but nothing got written to the table with the gather.
Is there a way to force the write after the gather in case this happens again?

 
You could use FLUSH [FORCE] to force the physical write. But a better approach would be to use table buffering instead of a scatter / gather. If you combined that with transaction processing, you would be pretty safe against this sort of problem.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
You could use an older technique that I employed before

Code:
do while not rlock()
enddo
[Commands that manipulate the record]
unlock
That way, the pointer waits until the record is enabled to modify, modifies it, and let it go.

Is an old approach, but may work for you...


 
Thanks for both of these suggestions.
Tried both of them and see the capabilities for how this program is setup.
 
[ ]

In FP2.6 I FLUSH after every edit. There is no noticeable time delay in editing the next record and the most new information that you can lose is in the current record you are editing.

mmerlinn


"Political correctness is the BADGE of a COWARD!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top