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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reverting Data

Status
Not open for further replies.

MaryG

Programmer
Mar 26, 2001
26
AU
Hi,
I have some fields on a page of a form that are updatable. I am updating the fields using record buffering, tableupdate. The fields appear to update successfully (tableupdate returns .T.) and if I browse the table once the fields have been updated I can see that they have also been updated on the table successfully.
However, once the user exits out of the form, the data is reverted back to its original state. It is as if the data hasn't been committed properly. I have looked at the example in the help and have tried using flush and set autosave on but I must be missing something obvious.
Any ideas please?????
 
It appears you have a row buffering (record buffer) and not a table buffer. Set table buffering or
use =TABLEUPDATE(2) and verify if it updates.
This will not generate errors, even if error is present.
I hope you got the clue ! :)
=========================================================
TABLEUPDATE([nRows [, lForce]] [, cTableAlias | nWorkArea]
[, cErrorArray])

nRows : Specifies which changes made to the table or cursor are committed. If nRows is 0 (or .F.) and row or table buffering is enabled, only changes made to the current record in the table or cursor are committed.

If nRows is 1 and table buffering is enabled, changes made to all records are committed to the table or cursor. If nRows is 1 (or .T.) and row buffering is enabled, only changes made to the current record in the table or cursor are committed.

If nRows is 2, changes made to the table or cursor are committed in the same manner as when nRows is 1. However, an error doesn't occur when a change cannot be committed, and Visual FoxPro continues to process any remaining records in the table or cursor. If cErrorArray is included, an array containing error information is created when an error occurs.

The default value for nRows is 0.
=============================================
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
 
Hi Ramani,
I did this but still had no luck. Then I figured out I wasn't removing buffering properly. Once I did this, it was working properly.
Thanks for your input.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top