I posted the wrong syntax for this. Try the following:
if rlock('0', 'tableA') then
unlock record 0 in tableA
endif
This worked with SET REFRESH set to 0,0 (no refreshing). Also, make sure all buffered changes have had TableUpdate() applied.
HTH.
>>>Two users posting transactions
>>>
>>>Use1 Posts a record to table A
>>>Goes to a differnt form that querries table A and the posted record is there.
>>>
>>>However User2 cannot see the record A just posted
>>>All the forms are running in private sessions, no views either. Simply Use in 0 shared.
>>>
>>>The only way User2 gets to see the record is to first close any open forms and then relaunch the form that querries table A again.
>>>
>>>What the heck is happening? I ruled out network issues because the system behaves exactly the same when launched twice on the same server.
>>>
>>>Anyone with a clue please?
>>>
>>>Thanks
>>>
>>
>>Mathias,
>>What is your setting for SET REFRESH? The default is 0 which means don't refresh anything. You can also use a temporary lock to refresh your data. Do the following:
>
>
>>if rlock(0) then
>> unlock record 0
>>endif
>>The lock will cause VFP to refresh the current cache. The unlock makes the table header availabel for others to do the same.
>>
>>HTH.
>
>
>Thanks Larry,
>
>Refresh is set to 1,3
>
>The the Lock / unLock hearder technique does work. I forces an instant refresh but the table has to be in 'browse mode' (or has to be browsed first).
>
>So If Browse the table, close the browse window and then run an sql querry, the new record is retrived. If I don't browse the table first all the lasted records are not retrieved.
>
>There must be a way to programmatically mimic the whatever it is Browse does to force a refresh.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao