>What is the best way to leave database files open during the entire time your program runs?
>
>I currently am using two database files and I'm running into stacking errors because the files open several times but do not close even though I use close all in the exit commands of forms.
>
>I have read that it is better to leave the files sit open while the program is running, how can I do this without running into a conflict while switching forms constantly?
>Thanks
Your probably getting the stacking errors due to use of private datasession in your forms dataenvironment, which causes VFP to re-open all tables even if they are open already.
You can either use Michel's idea on checking for datasessions, or change your forms to use default dataenvironment.
HTH,
John
John Adams
John T. Adams
Software Consulting Services