Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
'Requery' or some such thing
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00058738
Message ID:
00059497
Views:
40
>>I have a form that has 3 tables in the data environment. These tables are remote views with the data existing on SQL Server 6.5. When the user clicks the 'action' button, the application is supposed to look for an available number in one of these tables (if the 'assigned' field has a value of 'N' then it can be used). Once it finds the first available number it is supposed to lock the record, change the 'assigned' value to 'Y' and update the table to reflect the changes, and then unlock the record.
>>
>>The problem I am having is when multiple users are running this portion of the application they are pulling the same numbers (which is a BIG nono). I have tried 'requery' on each of the views each time the button is clicked but this does not seem to work.
>>
>>So, how can I be sure that each workstation has the latest data in their views? I am missing something here and could sure use some input.
>>
>>TIA,
>>George
>
>Make sure that the Where Type option on the Update page of the view is set to 'ID and Modified'. With this setting the update should fail if someone has beat you to that value. VFP should return an Update Conflict error.
>
>The basic idea is that you want to try to write a Y to the assigned column as long as the column contains an N:
>
>UPDATE table SET assigned = 'Y' WHERE pkey = id AND assigned = 'N'
>
>Only one person will be able to execute this query. For everyone else assigned will be set to Y and the query will fail.
>
>-Mike
Unfortunately this is how all of my remote views are configured. I am still getting duplicates. If anyone else has any ideas I could really use them right about now.

Thanks,
George
Everything we see or seems
Is but a dream within a dream
- Edgar Allen Poe
Previous
Reply
Map
View

Click here to load this message in the networking platform