Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error 2066 (undocumented) Index File xxx is corrupted...
Message
From
21/07/2003 14:48:49
 
 
To
21/07/2003 09:34:35
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00810798
Message ID:
00812107
Views:
31
>Hello Aleksey,
>
>We get often the 2066 error with VFP 8.0 (Index file corrupted...). We would like to trap it but we can't catch it with ON ERROR... (Error 2066 is not listed).
>
>CATCH TO ... reports it in the Exception object (no message though), but we don't want to add TRY ... ENDTRY structure to every method and functions that might change an order (hundreds of forms, thousands of fonctions).
>
>Is there a way either to turn off the warning, or to rely on a traditionnal ON ERROR... error trapping?

Hi Christian,

I have no problem with trapping error 2066 using ON ERROR. or TRY/CATCH.
Here is the code:
CLOSE DATABASES all
clear

ON ERROR

SET COLLATE TO "MACHINE" 

SET REFRESH TO 300

? 'SET("Refresh")=',SET("Refresh")	
?
DELETE FILE tbl51931.dbf
DELETE FILE tbl51931.cdx

CREATE TABLE tbl51931 (f1 c(100))
INDEX ON f1 TAG f1 

FOR I=1 TO 300
	INSERT INTO tbl51931 VALUES(PADL(TRANSFORM(I*1000),6)+REPLICATE('a',30))
NEXT


USE


? "Code for second client"

TEXT TO cSecondClient TEXTMERGE NOSHOW
	CD <<SYS(5)+SYS(2003)>>
	USE tbl51931 SHARED
	GO 104
	REPLACE f1 WITH "104001aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
	GO 117
	REPLACE f1 WITH "301001aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
	USE
ENDTEXT 

DELETE FILE SecondClient.prg
STRTOFILE(cSecondClient,SYS(5)+SYS(2003)+"\SecondClient.prg")

local ox as "visualfoxpro.application"
ox = CREATEOBJECT('VisualFoxPro.Application.'+TRANSFORM(INT(VAL(VERSION(4)))))

* open table in the first client
USE tbl51931 SHARED
SET ORDER to F1   && F1
INDEXSEEK("120000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")

? "modify table from the second client"
ox.DoCmd("DO "+SYS(5)+SYS(2003)+"\SecondClient.prg")
ox.Quit()
ox=null


? "do search"

ON ERROR ?"ON ERROR",ERROR(), MESSAGE()

*LOCAL oEX as Exception 

*TRY
	*INDEXSEEK("117000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
	LOCATE FOR f1="117000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
*CATCH TO oEX
*	?oEX.ErrorNo, oEX.Message 
*ENDTRY	

ON ERROR

return
Thanks,
Aleksey.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform