Jo Lynne,
There are a couple of possibilities:
1) The error may be honest; that is, Restructure needs exclusive access to the target table. It cannot be in use by anyone or anything. If the table is in use, you need to close it.
2) If you're sure the table isn't in use, then it may actually still be in use. There are a couple of ways to test this:
a) Try choose Window | Close All. You'll need to reopen the project viewer, but it works for most common cases.
b) If Window | Close All doesn't resolve the problem, then
try changing the working directory to a different directory and then change back to the current working directory.
Note: If you use the Project Viewer to do this, make *sure* you click the Set Current Directory button. (I usually use File | Working Directory, as I tend to forget to click that button.)
If you can resturcture the table now, that suggests that you've got something that opens the table earlier, but doesn't close it properly.
If that seems like what's happening, look for places where you use the table in a tCursor and make *certain* you manually close the TCursor.
Why? Although the docs suggest that TCursors automatically close when they go out of scope, I've see cases where that doesn't happen. It's more prevelant in older versions (e.g Paradox 5, 7.16, and 7.32), but I've seen cases in later versions.
In my experience, it's best to always close your Tcursors manually. A good way to do this is to add something at the bottom of your method in each event that uses a TCursor:
Code:
if tc.isAssigned() then
tc.close()
endIf
BTW, this is why you'll see stuff like that in almost all my ObjectPAL code for the last several years. It's a habit I forced myself to get into precisely because I would run into strange problems and this was one way to make them stop.
Now, it is possible that setting the working directory may not close all resources (such as a hidden form) because you can add code to forms that keeps them open when the user changes directories. (See
for details).
If you're still having the problem after changing working directories, try the following:
1. Exit Paradox.
2. Add the following options to the Target of your Paradox shortcut: -nec
3. Restart Paradox. Notice that it opens completely blank. That's what those options do. (See
for details.)
4. Try restructuring your table.
If it still fails, then either the table or the key may be corrupted. In this event, manually delete the indexes, rebuild the table, and then recreate your indexes.
That's pretty much a core dump of the various things that may be getting in the way. If it still doesn't work, then it's time to sacrifice a chicken to remove the voodoo curse.

)
Hope it helps...
-- Lance