>I need some clarification.
>
>I have a project that was converted to VFP6. At the end of each program there is a close databases command. This command was issued to close any open tables. However sometimes the tables get closed and at other times some tables get left open. This causes an error when another program tries to access the Table. The tables are being opened with the use tablename command.
>
>If I take the table out of the DBC and issue the use table name then Close databases, the table will close. If the table is in a DBC "close databases"
>does not always close the table.
>
>Has anyone else run into this problem before? Does anyone know what is causing this to happen? I know that a "close databases all" command will
>close the table. But I really do not want to go through and modify every program.
Just to add - Close Databases closes the data belonging to the current dbc. Close Databases All does close all the tables, but it also operates on the current data session only. So if you have multiple data sessions, it closes the tables in the current one only, and doesn't touch the others.
What you can do is to issue na aused() at the beginning, and another one at the end (of the code you want to bracket) and then close any alias mentioned in the second one but not in the first array.
Another thing which may prevent closing tables is any unresolved stuff in the buffers. Any tableupdate() which fails, leaves the buffers unsaved. You have to tablerevert() them, or resolve the issue until tableupdate() succeeds, or else you can't close the tables.