Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
1707 again ( sorry )
Message
From
01/10/2005 08:20:22
 
 
To
01/10/2005 06:29:20
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP4
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01055198
Message ID:
01055219
Views:
16
>Fabio, tried as you proposed but seems no luck:
>
>If CDX exist I got "TABLE OPEN AT TRY: 1" and if not "TABLE OPEN AT TRY: 2" but ON ERROR is
>not triggered ?!
>
>Gojko

Gojko,
now remember this issue ( a bug ).
I post it some months ago.

The first time,
besides producing the error,
VFP removes the definition of the cdx,
in this way the second time cannot verify him the error.

Logic is:
you have lost the CDX, then we remove the link to him from the table,
and we shoot you an error, with which you can restore the CDX,
if you don't do then it it means that it doesn't interest yourself
to have it lost.

It can apparently have sense,
because if the link is considered as "one cdx exists",
then it won't be possible to create a new cdx,
BUT this is the logic bad start point,
because the true meaning of the flag is
"it looks for a struct cdx and if it exists open it,
otherwise fire a error".

This produces to serious problem that is the motive
for which I call it "design bug",
because if for some reason during the resolution of the first error
something doesn't work (App crash, VFP crash, OS c... )
the following time finds again yourself without cdx and without errors.

Probably after a certain number of lines it will occur an error,
but it is easy to write an example where the data it can be ruined
without the application can realize of it.

This myopic vision is present in many VFP places.
#DEFINE TABLENAME testtableX

CLEAR
SET STEP ON 
CLOSE DATABASES ALL
CLOSE TABLES ALL
* FREE TABLE
CREATE TABLE TABLENAME  FREE (AA I)
INDEX ON AA TAG T1
USE
* erase cdx
ERASE FORCEEXT([TABLENAME],"CDX")
ON ERROR ? ERROR(),MESSAGE()
SELECT 0
USE TABLENAME ALIAS TIPOO	&& this fire a CDX error and remove the CDX definition !
? "ALIAS ",ALIAS()
USE TABLENAME ALIAS TIPOO	&& this cannot fire the error
* WORKAROUND BEGIN
IF ISBLANK(CDX(1))
	USE
	ERROR 1707
ENDIF
* WORKAROUND END
? "ALIAS ",ALIAS(),"STRUCTURAL INDEX :",CDX(1)
CLOSE TABLES ALL
ERASE FORCEEXT([TABLENAME],"*")
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform