Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is this a bug?
Message
From
21/07/2002 21:56:24
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00680753
Message ID:
00680977
Views:
22
Hi, Joe-

>I been trying to figure this out for some time and now I can duplicate
>it. The problem is caused by the updating the field in the table when
>it has an index. Remove the index (or don't update the index field)
>and everything works ok.
>
>Is this a bug?

No, but it sure was a good puzzle. The problem, basically, is that you have both the view and the table the view is based on, buffered. If you close test before using your view (and remove the CursorSetProp for it), then your code works fine. Or, if you TableUpdate Test after the first TableUpdate of View1, your code works fine. I don't know the mechanics of why the view record gets deleted after the second update. Suffice it to say...don't do that. *g*.

Rule of thumb, don't buffer (don't even open if you don't have to) the tables views are based on. Using the view is enough.

That was a good puzzle--would be a heck of an prospective employee question. Nice that you included a runnable example. Thanks.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform