Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL SELECT doesn't grab current data
Message
 
 
To
13/07/2001 11:17:23
Frank Ball
Santech Industries, Inc.
Fort Worth, Texas, United States
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00530279
Message ID:
00530299
Views:
14
>Visual 6.0 SP5. I'm doing an SQL SELECT from a form in a private data session. As long as the application is running, I can hit the SQL SELECT a hundred times. It won't pick up a change in the data made by an another application. The only way I can see the change is close and restart the application. BufferMode is 0 None.
>
>Using different clients for the data change and the read makes no difference. As soon as the app has done the first SQL SELECT, the cursor doesn't display the change in the server's data.
>
>Any ideas on what's going on?

Once the data is cached into local buffers, VFP won't read the network presence unless you tell it to. You can play with the SET REFRESH command. If that fails (and there is at least one instance where it does), you can create your own function to refresh the buffers. Ex.
lparameter tcalias
if used(tcalias) then
   if rlock('0',tcalias) then  && lock the table header to refresh local buffers
      unlock record 0 in (tcalias)
   else
      * lock failed so bufferes were not updated; you can try again or not
   endif
else
   * alias not open so there is no point in refershing it
endif
The failure mentioned above seems to occur when tables are opened in the Default datasession (#1) and subsequently used in private datasessions. VFP ignores the SET REFESH setting or it simply doesn't work. In cases like this, the RLOCK() method works everytime.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform