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

When, EXACTLY, does a form's data get written to disk? 3

Status
Not open for further replies.

plepkowski

Programmer
Jul 22, 2005
17
US
Say I've got a form with a bunch of fields, a cancel button, and an Accept button, and it was written by someone who is not available.

When does the form's data get written to the disk. I need to add new data validity checks before writing to disk.
 
It depends on whether the underlying tables are buffered.

If they are, then there will be a TABLEUPDATE() somewhere in the form - probably in the Accept button. It is the TABLEPUPDATE() that causes the data to be written.

If the tables are not buffered, then the data will be written as soon as the controls on the form are edited. In that case, the best place to do the validation is in the Valid events of the relevant controls.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
It depends. There are basically 3 ways:
-Unbuffered. Data is written as it is edited.
-Row Buffered. Data is written with an explicit call to TableUpdate() or update is called implicitly as record pointer moves off the record.
-Table Buffered. Data is written with an explicit call to TableUpdate().

You can start by checking what is in 'Accept/Cancel' button clicks and what is the table's buffering mode. You can also write record level validation checks directly as a rule in table definition.

Cetin Basoz
MS Foxpro MVP, MCP
 
As others have said above - "IT DEPENDS on how the form was developed to work!"

Are your form textboxes bound directly to table fields?

Look at the textbox's ControlSource to find out.

If they are bound then it depends on the buffering of your table (as discussed above) - generally, unless unbuffered, when the TABLEUPDATE() command is issued.

If not, then the textbox data is written to memory variables or form properties and not table fields. Under this situation, the backend updates occur when the REPLACE command is issued.

Good Luck,
JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top