Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error, How to Reindex()
Message
General information
Forum:
Visual FoxPro
Category:
Stonefield
Miscellaneous
Thread ID:
00474129
Message ID:
00475726
Views:
29
Hi Steven,

>>Questions:
>>-So, is there no way to – or how do I – issue one Reindex() against all >>tables listed in meta data .AND. .NOT. present the user selection dialog? Or >>must I issue multiple Reindex() with a different SetDatabase() each time?

Unfortunatly yes, for each DBC and your set of free tables you must issue a Reindex() for each with a different SetDatabase().

>>-My intent is to simply ask NeedReindex(‘ALL!’) against all tables listed in >>the meta data, and if any one of them does need to be reindexed, I expect >>a .T. would be returned. Right?

If you are only wanting to reindex() tables that NeedReindex() returns .t. for, then your best bet is to spin through your tables calling NeedReindex on each and if a .t. is returned then call reindex with that table but you will want to do this with first your DBC contained tables then your free tables because the syntax differs as you see in the manaul.

For Repair(), you are correct in your findings. Repair() will return a .t. if it could repair and reindex the table and a .f. if it could not. This is not to be confused with needing repair or not. As you have noticed the testerr.prg is how we recommend testing if a repair is required.

>>Pehaps it might be cool if there was a NeedRepair().

SDT would have to attempt to open a table in order to trap an error to confirm corruption, this would mean SDT would have to override a developers application error handler which may already be handling the issue with specific warnings or event logging. Therefore we find it less obtrusive to just recommend additions to an existing error handler.

Hope this helps you out.
Yuanitta
Senior Consultant
Stonefield Systems Group Inc.
www.stonefield.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform