Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error message command cannot be issued on a table
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00649809
Message ID:
00651024
Views:
34
>>>>>>>>On the form I have a grid linked to view called lv_status_tbl. In the dataenvironment I have a table exclusive status_tbl and a view lv_status_tbl. I have set buffering mode to none, optimistic and pessimistic but not difference. I am issuing the following commands in my cmdzap button:
>>>>>>>>
>>>>>>>>
>>>>>>> select status_tbl
>>>>>>>>SET SAFETY OFF
>>>>>>>>ZAP
>>>>>>>>SET SAFETY ON
>>>>>>>>REQUERY('lv_status_tbl')
>>>>>>>>thisform.Refresh()
>>>>>>>>
>>>>>>>>
>>>>>>>>Does anyone know what I am doing wrong?
>>>>>>>>
>>>>>>>>Thanks
>>>>>>>>Nick Patel
>>>>>>>
>>>>>>>Put select your table before ZAP command
>>>>>>Thanks for replying. Now I get the message that "file must be opened exclusively" and in my dataenvironment the status_tbl has exclusive=.t. If I do the following:
>>>>>>
>>>>>>
>>>>>>Use status_tbl exclusive
>>>>>>select status_tbl
>>>>>>SET SAFETY OFF
>>>>>>ZAP
>>>>>>SET SAFETY ON
>>>>>>REQUERY('lv_status_tbl')
>>>>>>thisform.Refresh()
>>>>>>
>>>>>>
>>>>>>I get message that "file is in use"
>>>>>>
>>>>>>Thanks
>>>>>>Nick Patel
>>>>>
>>>>>I guess, somewhere in the code you open this file shared, or somebody else opened it.
>>>>>
>>>>>Anyway, try:
>>>>>use in select('MyTable')
>>>>>select myTable alias WorkTable again in 0 exclusive
>>>>>zap
>>>>>....
>>>>I got a error message when I save my form saying:
>>>>
>>>>command contains unrecognized phrase/keyword
>>>>
>>>>for the line:
>>>>
>>>>
>>>>SELECT status_tbl alias worktable again in 0 exclusive
>>>>
>>>>
>>>>I wrote the following code:
>>>>
>>>>
>>>>USE IN SELECT('status_tbl')
>>> select 0
>>>>USE status_tbl alias worktable exclusive
>>>>SET SAFETY OFF
>>>>ZAP
>>>>SET SAFETY ON
>>>>REQUERY('lv_status_tbl')
>>>>thisform.Refresh()
>>>>
>>>>
>>>>Thanks
>>>>Nick Patel
>>>
>>>It should be USE instead of SELECT. Sorry, my typo in the original message.
>>
>>I changed the error line to USE and ran the code, I still get an error message saying:
>>
>>Command cannot be issued on a table with cursors in table buffering mode.
>>
>>So I set the buffermode to (none) for the form and the code ran. My data didn't get zapped however.
>>
>>Thanks
>>Nick Patel
>
>View is always open in buffered mode. You should zap your table before opening the view or if you need to zap it the live of the form you need to temporary close the view and after you've done with 'zapping', re-open the view again.

Thanks for replying back. How do you close a view and then reopen?

Thanks
Nick Patel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform