Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record Locked BY another user
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00505648
Message ID:
00505845
Views:
14
>I have a frustrating problem I can't figure out.
>
>I have a workcursor on a form created with
>CREATE CURSOR WORKSPEC FROM ARRAY aFFLDS
>
>When I am in a grid if I modify a field and tab out the command
>
>replace workspec.artno with 'blah'
>
>is executed.
>
>If I move up and back to the same field and type a new value
>the command
>
>replace workspec.artno with 'blah2'
>
>is executed.
>
>At this point I get the error "record locked by another user"
>
>The cursor is open excl
>buffering is set to 5
>
>In the command window I type
>UNLOCK
>REPLACE... &&same error
>
>UNLOCK ALL
>REPLACE... &&same error
>
>TABLEUPDATE
>REPLACE... &&same error
>
>TABLEUPDATE(.t.)
>REPLACE... &&same error
>
>TABLEREVERT()
>REPLACE... &&same error
>
>TABLEREVERT(.t.)
>REPLACE... &&same error
>
>Two questions. Why does it do this?
>Why can't I unlock it??
>I need the buffering to detect changes in the lines.
>
>Other grids built the same way do not have this behavior.
>
>Any ideas?


I struggled with this issue a while back. If my memory serves me right, it has to do with the fact that the grid has focus and it's trying to refresh itself, therefore, read thru all the records at the same time you're trying to update a record. The solution is to move focus off the grid, then do your REPLACE, then move focus back to the grid.

Hope this helps,
Cathy
Cathy Pountney, Microsoft Visual FoxPro MVP
Memorial Business Systems, Inc. (www.mbs-intl.com)

My Website: (www.frontier2000.com)
My Blog: (www.cathypountney.blogspot.com)
My Book: The Visual FoxPro Report Writer - Pushing it to the Limit and Beyond
Free MSDN Article: What's New in the VFP 9.0 Report Writer
Free MSDN Article: The VFP 9.0 Report Writer In Action
Previous
Reply
Map
View

Click here to load this message in the networking platform