Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding those left-hanging-around open tables
Message
From
26/12/2005 14:04:27
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01080838
Message ID:
01080866
Views:
16
>When VFP asserts a SELECT-SQL statement with a table, it leaves the table open even if it was not already open. However, it does not put you in the workarea (or tell you the workarea) in which the table was opened. If you do SELECT from two tables with the same file name (different folders), then you end up with one alias named according to file name, and the other alias name is made up by VFP (an ABC letter). Lets assume that both of those tables need to be opened/accessed at the same time. The question then, when it's time for cleanup, is how to find those "Left-hanging-around" tables so you can explicitly close them. Any suggestions? Thanks very much.

This seldom is a problem for me; on the contrary: I am happy the tables are kept open, since that means faster processing. To reduce problems:

All forms should use private datasessions. This means: no conflicts between different forms; tables opened in a form are closed automatically when the form closes.

If you use a table in many places in a form, open it early on.

If you temporarily need a table later, open it with something like this:
use client again order client alias client_forsearching
The AGAIN avoids conflicts in case the table was already open; the ALIAS is assigned with some name you are not likely to use anywhere else.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform