Why not run a method from the calling program that opens the tables and leaves them open.
Then call the processing method X number of times in the calling program.
Then run a method from the calling program that closes the tables.
How are the variables created? If they are just assigned a value, they are private by default. This means they are in scope until the method is completed (ie. they are in scope for that method and lower level (called) method).
I would experiment with very simple examples and see what works best in your situation.
Joe
>I'm trying to find out what is the correct way to handle opening and closing of dbf's within com object with respect to time and scalability. If I create a component which has a method which receives several parameters, opens several tables does something and returns a value. What is the proper way to handle to opening and closing of the tables (i.e cleanup). The first time the method is run the tables are not open so I have to open them, I run the method should I close the tables explicitly or do they close automatically when the object is destroyed. Also throughout the day I may hit this object and method many times. If I don't open/close each time would that be a significant number of opens and considered inefficient. As you can probably tell I am little confused about the whole notion. Along the same lines, what about variables that are created in the method. Should I explicitly release any that I can before the end of the method or does it matter.
>
>Any info would be great...
>
>Thanks
>
>
>
>Scott
Joseph C. Kempel
Systems Analyst/Programmer
JNC