>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
unlock record 0 in (tcalias)
else
endif
else
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.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao