Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursor problem # 2
Message
From
04/02/2003 07:45:22
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00748797
Message ID:
00748799
Views:
15
This message has been marked as a message which has helped to the initial question of the thread.
>I asked for help yesterday on how to destroy a cursor. I got tons of replies (thanks!), however, I'm still in a pickle. I'm trying to destroy a cursor but whenever I do it also messes up my connection with other open tables on the same form:
>
>Just select the cursor then USE
>SELECT myCursor
>USE
>
>That was yesterdays suggestion...and it does destroy the cursor but then I can't access my current table.... but if I try and use that table... it says it's still in use..... I'm lost..

I think the problem is that you change the work area. Some commands work only for the selected work area.

Try closing the cursor without changing the work area, thusly:
USE IN MyCursor
In other, more complicated, cases, if you need to temporarily change to a work area, you have to go back to the previous work area, to avoid problems. This is especially important in a UDF.

The following code has the same result as the one-liner above, but illustrates how to save work areas. In this particular case, it is not necessary of course.
* First, save work area
local lnWorkArea
lnWorkArea = select

* Now, go to another work area
select MyCursor
use

* Return to previous work area
select (lnWorkArea)
HTH, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform