Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
View simple problem
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00439246
Message ID:
00439254
Views:
21
>Hi everybody,
>
>In my code (currently it's a program, lately I may make it to be a form's method) I open a view by use vAllStatConfigs in 0 nodata alias WorkConfig. Then I assign view parameter and requery(). In Data Session now there are 4 tables open: 3 tables, on which view is based and the view itself. My question is: how can I close these tables automatically? When I issue use in WorkConfig, all three underlying tables remain opened...
>
>Thanks in advance.

Without writing a CloseView function, you can't. The function could parse the return value of Cursorgetprop("SQL",myView) to find the FROM clause and get the tables. Then it could issue a USE for the view as well as the tables.

I recommend using the SQL property and not the Tables property because it is not inclusive. Tables only holds references to updateable tables and the view could include any number of no-updateable ones.

Other than that, you need to remember to close them when you close the form. Are they causing a problem for you or are you just trying to clean up after yourself? Because the tables will close when the datasession they are opened in goes away.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform