Solved

Application data (Edit Box) not refreshing when data is changed remotely by a Browse window.

Posted on 2010-09-15
13
513 Views
Last Modified: 2012-05-10
Sorry about "long title".  Here is the issue.  My Foxpro application is running properly.  Sometime I have to change / correct data using Foxpro command from development PC.  Doing so, corrected data not showing on application unless I quit application.  
Application opens table in SHARED mode.  When connecting to a table using Foxpro commands, also connecting SHARED.  Application still does not show updated data even after closing table from Foxpro command.  Updated data will only be shown by Application after quit and restart.
Any ideas !?
0
Comment
Question by:meep_meep
  • 6
  • 5
  • 2
13 Comments
 
LVL 42

Expert Comment

by:pcelba
ID: 33685350
It could mean the Edit box or its source data is not refreshed. What is the Edit box ControlSource?

Did you try to skip to another record and back?
0
 
LVL 42

Expert Comment

by:pcelba
ID: 33685418
Also to refresh Edit box by actual data from the current record you have to issue Refresh method of the Edit box or you may refresh the whole form

Appropriate SET REFRESH setting is also required.
0
 

Author Comment

by:meep_meep
ID: 33685669
Yes I tried to skip to another record and back as I also, for testing purposes, add a specific button to "force" Edit box refresh.  Still no updates on application form.  Foxpro help is referring to Data Session.  My form is DataSession = 1.  There is some weird situation, however.  If 2 application are started, sharing same data, changing grid data on one form will make other application refreshed record moves.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 29

Expert Comment

by:Olaf Doschke
ID: 33685947
Are you binding to tables or views or queried data? Changes in the table will not take effect if what you display rather is a view. You'd need to requery the view, refreshing the controls does not help then.

Bye, Olaf.
0
 

Author Comment

by:meep_meep
ID: 33686047
I'm not exactly sure what you mean by Binding to tables but I'm making text control source = TableName.FieldName so I assume I am binding to table.  Edit box have ControlSource same way as TableName.FieldName.  I point: if I change value of a grid cell in App "A", changing recno in App "B" will make change visible on App "B".  If I change EditBox content in App "A", change will not reflect in App "B" unless I quit and restart App "B".
It looks like App "B" is assuming no changes done on EditBox object (with ControlSource = TableName.FieldName) while it is noticed when change is done by App A Grid.  Sounds like DataSession ...
0
 
LVL 42

Expert Comment

by:pcelba
ID: 33686612
Lets assume

SET REFRESH TO 0,5  && VFP default value

Set some record in "App A"
Set same record in "App B"
Change the Editbox contents in "App A"
Skip to another record in "App A"  -  this will release possible locks and flushes buffers to disk
Wait 5 seconds -  this will update buffers (but nothing else) in "App B"
"App B" should still display the original value  (because Edit box was not refreshed yet)
Skip to another record and back in "App B"  -  the Edit box value should be updated at this point.

Above scenario does not suppose any table/row bufferring. If your form contains some kind of data bufferring then you just have to ensure data saving in "App A" after data change.

If all above steps were done but "App B" data still remain unchanged then you don't have table data directly binded to your form controls but they are using e.g. cursors etc.

Data sessions should not have such bad influence to your form behavior.
0
 

Author Comment

by:meep_meep
ID: 33687580
Ok.  App "A" is application running on "A" PC.  App "B" is application running on "B" PC.  So both PC run same application (on their C:\Program Files\...)  Data are located, let say on a "C" PC.  Using Foxpro programming software to open table in "C" PC, browse table.  App "A" form is showing a Grid and an EditBox (grid has controlSource to one table while EditBox has another table as ControlSource).  EditBox is related to Grid Table.  So, as rec change in Grid, edit box is showing something different (according to the Set relation).  From "A" PC, change EditBox content while "B" PC is located somewhere else.  Wait a minute then place REC on "B" PC to show same REC as "A" PC.  "B" PC EditBox not updated.  
From that point, open table in "C" PC and browse content of the Edit Box: content updated un browse but still not updated on "B" PC.
Looks like example in Help (VFP 9.0 SP2): How to: Manage Multiple Instances of a form... :S

As you are saying, how can I find out if my form has the EditBox ControlSource not directly binded but buffered ?!
0
 

Author Comment

by:meep_meep
ID: 33687656
Other info.  Does same result in Edit Box if I have only one application running and Visual Foxpro on another PC modifying EditBox content.   However, if Foxpro is modifying Grid content, application is updated as soon as RECNO is changed (on application).
0
 
LVL 42

Accepted Solution

by:
pcelba earned 500 total points
ID: 33687666
So, if the browse window shows the right data then the problem is in Edit box refresh.

The Edit box seems to be binded directly to the table field. The only remaining possibility is SET REFRESH settings. What value do you use in your app?

Table and/or row buffering is easily recongnisable if you search for following commands (or their parts) in your source code:

TABLEUPDATE( ...
CURSORSETPROP("Buffering", ...

0
 

Author Comment

by:meep_meep
ID: 33687872
WOW, you're making my day today !!!  Set refresh was set to 0,0.  What values would you recommend?  We're looking to place application on a Terminal Server (which is making multiuser approach serious boost).  For testing, I place Set Refresh 1,5
0
 
LVL 42

Expert Comment

by:pcelba
ID: 33690349
SET REFRESH 1,5  means  1 second refresh in Browse window (which you probably don't use in your app) and 5 seconds for common data buffers refreshing. It should be OK but you could even use higher value to reduce network traffic.

Terminal Server can also reduce network traffic but it consumes server resources a lot, so everything depends on your server hardware. Standard file server topology on a reliable network hardware can serve more users on weaker hardware but everything depends on your company rules and plans.
0
 
LVL 29

Expert Comment

by:Olaf Doschke
ID: 33695433
You can actually stay with REFRESH 0,0 as long as you skip from the record in PC A and refresh by skipping back and forth in PC B the value would also refresh. As pcelba said it much depends on buffering settings. There's also SYS(1104) or FLUSH to flush buffers (on A).

Bye, Olaf.
0
 

Author Comment

by:meep_meep
ID: 33695772
With REFRESH 0,0, Grid data was updating properly while skipping back and forth either PC.  However, EditBox data was not updating.
0

Featured Post

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
TSWEB on windows 7 1 1,139
FORM caption height 4 209
Do you know  how to transmit a string from a VFP application to a Web server ? 13 164
FoxPro Version 9.0 2 69
Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
This article explains the steps required to use the default Photos screensaver to display branding/corporate images
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question