Reindexing database different from deleting .ind file

Steve Albin steve at steve-albin.com
Sun Jun 22 15:04:53 CDT 2014


I have a user who periodically gets a corrupt index.  The problem occurs when he adds a record and then displays the new record and other similar records in a list box.  The new record will show up multiple times.  It is not a bug in my app because he's sent me the database and I can reproduce the problem using the SQL editor in Valentina Studio.  

We've not found the bug that causes the index corruption, but my question is on recovery from the problem.  My app has a reindex menu item that when selected simply performs a sqlExecute("REINDEX DATABASE") on the database.  In most cases, this fixes any index problems.  In this case, it does not work.  What will work is if we quit the app, delete the .ind file and then restart the app.  The same SQL shows not repeating records.

Why does the deletion and recreation of the index work better than the sqlExecute("REINDEX DATABASE")?  Fortunately, for this user, there is a separate index file we can delete.  But if my user had a database with the index and data in the same physical file, we would not have a recovery for the corrupt index.  

I'm using V4RB 5.5.1 and this problem is happening on the Mac version of my app.  Any suggestions for making the reindex work from within the app would be appreciated.

Thanks, 
Steve


--
Steve Albin, Montclair, NJ
http://www.steve-albin.com
http://www.jazzdiscography.com



More information about the Valentina mailing list