Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP9 and cascade view - bug ?
Message
From
30/05/2005 13:16:33
 
 
To
30/05/2005 11:13:55
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01018547
Message ID:
01018561
Views:
10
>Hi,
>I've found the following bug (??) in VFP 9 opening cascade view with NODATA clause.
>I open the view with the NODATA clause and after issuing REQUERY():
>- in VFP 8 I get the result of 2 records - as expected
>- in VFP 9 I get an empty cursor - as not expected
>
>In VFP 8 opening the view V_Upper with the NODATA clause prevents only this view
>from filling with data, the view V_Lower has its data in place. Following REQUERY()
>than works as expected.
>
>In VFP 9 opening the view V_Upper with the NODATA clause prevents both V_Upper both
>V_Lower from filling with data. Following REQUERY() does not fill the V_Lower
>with data, so the resulting V_Upper is empty too.
>
>Is this a bug ? Is it expected to be corrected in the VFP 9 SP1 ?
>If it is not a bug, but the feature, why it is not mentioned in the VFP 9
>documentation in the chapter "Changes in Functionality for the Current Release"
>in the "Critical Changes" section ?
>
>Any suggestions ?
>Have I to wait for VFP 9 SP1 or have I to rewrite my applications ?
>
>Here is the code (only for bug-demo):
>
>
>CLOSE DATABASES ALL
>
>CREATE DATABASE TryDB
>
>CREATE TABLE TryTable ( Jmeno C(10) )
>INSERT INTO TryTable VALUES ( "Igor" )
>INSERT INTO TryTable VALUES ( "Jane" )
>
>CREATE SQL VIEW V_Lower AS SELECT * FROM TryDB!TryTable
>CREATE SQL VIEW V_Upper AS SELECT * FROM TryDB!V_Lower
>
>USE IN V_Lower
>USE IN TryTable
>
>USE TryDB!V_Upper NODATA
>REQUERY()
>* resulting in empty BROWSE, while expecting 2 records
>BROWSE
>
>CLOSE DATABASES ALL
>
This is a VFP bad design.
But VFP8 have a issue too, and the magic is a illusion.

Try this on VFP8 and 9:
CLOSE DATABASES ALL

CREATE DATABASE TryDB

CREATE TABLE TryTable ( Jmeno C(10) )
INSERT INTO TryTable VALUES ( "Igor" )
INSERT INTO TryTable VALUES ( "Jane" )

CREATE SQL VIEW V_Lower AS SELECT * FROM TryDB!TryTable
CREATE SQL VIEW V_Upper AS SELECT * FROM TryDB!V_Lower

USE IN V_Lower
USE IN TryTable

USE TryDB!V_Upper NODATA
* 
BROWSE
INSERT INTO TryTable VALUES ( "Tarzan" )
* Expected 3 Records
REQUERY('V_Upper')
BROWSE
* now do a cascade requery ( expected VFP job )
REQUERY('V_Lower')
REQUERY('V_Upper')
BROWSE

CLOSE DATABASES ALL
At least, now VFP9 is faster and more coherent.

Workaround:
using CURSORGETPROP("Tables").
Previous
Reply
Map
View

Click here to load this message in the networking platform