Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

applying a temporary update to a permanent file

applying a temporary update to a permanent file

applying a temporary update to a permanent file

We are having a problem that requires an innovative solution.

Using Visual Accountmate we are writing system for a carpet distributor.

The basic structure is...

The ITEM FILE has the name of a style and color of carpet
i.e. - Atlantic-0001 (this is a unique item)

For each Item there are an unlimited number of ROLLS OF CARPET FILE
i.e. Roll # 0001, 0002 etc.

For each ROLL there are an unlimited number of TRANSACTIONS PER ROLL FILE.
For example, if Roll 0001 has 100 feet of carpet on it
20 feet could be committed for sale to Company A
50 feet were sold to Company B
10 feet are on a sales quote for Company C
5 feet were discarded as damaged
leaving 15 feet on the roll

When the end user wants to assign X feet to a sales order he or she sees both the summary and detail status of all the rolls under this item.

The problem is in showing REAL TIME status. We would prefer NOT to update the real databases constantly because if the user assigns 10 feet from roll 1 to an order...and then changes his mind, we need to re update 6 permanent databases.

So, what we have been doing is building a temporary file, based on the current status. We then have been updating, when the whole order is saved.

The problem with this approach is two fold...
If I assign 10 feet to roll 0001 ... then create a new line item for the same Item # (same carpet style)...we are not seeing the real status of the roll, since we do not update the permanent file until the order is saved.

If another user sells the same item, he is not seeing the real time status...and may accidentally over sell the roll.

What we need is a way to show the real status of each roll, but hold the permanent update until we save the order. My initial thought was to add a field to the roll transaction file. This field would be filled with something like "username". This record would be included in the
roll status update...because it is a real record in the roll transaction database. When the order is saved, the records for this roll, with this username in the new field would be deleted, and the update would proceed normally.

However, I am open to suggestion on a better method.


RE: applying a temporary update to a permanent file

I would add the field to the databases and create a new table.
Table - Sales Order Numbers. The sale number field would be unique. There you can keep information about the sale , Name address, status, quote, sale, completed (etc).

When a record is removed from the Sales Order Number Table the associated records with that Sales Number can be deleted from the main tables.

If you are using Database Containers you can add the table to the database and make it a table rule.
If not you will have to write a routine that opens all the tables and delete all for sales number = ######

RE: applying a temporary update to a permanent file

Thanks for the response.
We are working on what you suggested.
With simple transactions its clean.
When 3 users ASSIGN, UNASSIGN and RE ASSIGN without saving, however,
we are still having some problems.


RE: applying a temporary update to a permanent file

We have the software to a point, where...as long a user Assigns (adds a record) or unassigns (deletes a record), THAT user sees updated data (i.e. the refresh really reads from the drive)....however,

If a user just looks at the data, we cannot seem to force a real read from the data file on the drive.

Is there some sort of 'commit' or 'flush buffer' command in VFP?


RE: applying a temporary update to a permanent file

You did not say if the second user was looking a browse window or a form screen.

If it is a browse window - Check out the setting of your SET REFRESH COMMAND Change your setting in the program that is first called from the command line / windows that starts the program application.

If it is a form check out the BufferModeOverride Property of the form.

Following is the FoxPro Help on the REFRESH command:
Determines whether and how often a Browse window is updated with changes made to records by other users on the network.


SET REFRESH TO nSeconds1 [, nSeconds2]


TO nSeconds1 [, nSeconds2]

Specifies whether and how often updates are made. nSeconds1 specifies the number of seconds between updates to a Browse or memo-editing window. nSeconds1 can be a value from 0 to 3,600; the default value is 0 seconds. When nSeconds1 is a nonzero value and other users change records you are viewing, those records are updated when the refresh interval elapses. The records you are viewing aren't updated if nSeconds1 is 0.

Microsoft Visual FoxPro buffers portions of tables in memory on your workstation. nSeconds2 specifies how often these local data buffers are updated with current data from the network. nSeconds2 is the number of seconds between data buffer updates. You can specify a value between 0 and 3,600; the default value is 5. The buffers are never refreshed if nSeconds2 is set to 0.

If you specify a value for nSeconds1 other than 0 but don't include nSeconds2, nSeconds2 is set to the same value as nSeconds1. However, nSeconds2 is set to 5 if you specify 0 for nSeconds1 and don't include nSeconds2.

Performance can be improved by increasing the value of nSeconds2.


Because tables can be opened for shared use on a network, it is possible that records you are viewing in a Browse window are being edited by other users on the network.

SET REFRESH affects records displayed in a Browse window opened with BROWSE, CHANGE, or EDIT. Memo fields opened for editing in a Browse window are also updated.

SET REFRESH can also be used to specify how often data buffered locally on your workstation is updated.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close