Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update cursor!!
Message
 
 
To
19/12/2000 09:56:13
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00454668
Message ID:
00455035
Views:
38
>Hi,
> yes, it work!!!
> Thank you

The problem was the following line:

USE DBF("mycursor") AGAIN SHARED

Because you didn't specify a new workarea, VFP attempted to use the current one. The first step VFP takes in this situation is close any open cursor in that workarea before opening the new cursor. When it closed DBF("mycursor"), the disk presence went away and the subsequent USE failed.

As Sergey suggested, you needed to select a new workarea using SELECT 0. You could have specified the new workarea in the same command:

USE DBF("mycursor") AGAIN SHARED IN 0 ALIAS MYCURSOR1

The other problems you faced that Sergey's post addressed was the fact that you need to have unique names when opening a cursor for read/write. If you don't specify AGAIN, VFP thorws an error saying the file is in use. If you use AGAIN but keep the same alias name, VFP throws an error stating the alias has already been used.

Ex.
Select * from mytable into cursor tempcursor NOFILTER
Use dbf("tempcursor") AGAIN IN 0 ALIAS MyRealAlias
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform