Dave
Dave Crozier wrote:
> Paul,
> If the index does get deleted you will not get an error when opening the
> file but you WILL get a "Database Container is invalid, validate" message.
> You can simply recreate the index using modi comm. Or by code which
> sometimes throws an error but you can ignore this and the index will be
> created OK.
>
> Try it:
> Delete file <<fname.cdx>>
>
> Open <<fname>>
>
> Set order to <<tag>>
>
> Then modi comm. The table and recreate the index...it will blow back an
> error but ignore it and the index is created correctly.
>
> It is obviously useful to validate the database just to make sure
> everything
> is OK and you need to have it open exclusively to do this.
>
> Dave Crozier
What you describe is just what I have found and my original ON ERROR
routine was not invoked when the "Database Container is invalid,
validate" message appeared. In the end I came up with the following
(which seems to work fine):
lcOldError2 = ON("ERROR")
ON ERROR DO ckerror2 WITH ERROR(), MESSAGE()
lcOldSafety = SET("SAFETY")
SET SAFETY OFF
TRY
INDEX ON &lcIndexExpr
CATCH
INDEX ON &lcIndexExpr
ENDTRY
ON ERROR &lcOldError2
SET SAFETY &lcOldSafety
ENDFOR
RETURN
*****************
FUNCTION ckError2
*****************
PARAMETER tk_error,tk_message
IF INLIST(tk_error, 0, 1561)
RETRY
ELSE
RETURN
ENDIF
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.