Don't worry about it. VFP handles updating the base table of a view
automatically. the base table is opened when you open the the view, USE
view, you can open the Data Session window see what's open. You can close
the base table if you like. In a tablebuffered view you can Insert, Delete
or Update data till you call TableUpdate(.T.). Only then is the base table
opened again - and you can close it again if you like. A
REQUERY('viewname') will also open the base table.
A query will usually open the base tables with entirely new aliases.
Don't refer to open tables by workarea letters or numbers. Refer to open
tables by their alias. You can check if an alias is already used; if not
open the table with the alias you want
IF NOT USED('Customers')
USE Customers AGAIN IN 0 Alias Customers
Endif
* SELECT Customers
Now you have the table opened with an alias you're sure of. The workarea
letter or number is immaterial. For all you know the same table can already
be open several times under other aliases. It doesn't matter.
-Anders
Post by CMThank you. One other question though...
If I use these statements to open free tables, how do I determine which work
area they end up in? Usually, my routines involve replacing fields in the
view with fields in the free table(s) - such as REPLACE A.FIELD1 WITH
G.FIELD5 - where A is the work area containing my view and G is the work area
containing the free table.
Thanks again,
CM.
Post by Fred TaylorYes, the main tables are opened in other work areas when you USE a view.
That's why you should always USE freetable IN 0 or do a SELECT 0 before you
do a just plain USE freetable (or any table/view for that matter).
--
Fred
Microsoft Visual FoxPro MVP
Post by CMWhen I open a database and use a view in a given work area, are the base
tables open in other work areas?
I make changes to fields in the view and those changes get pushed back to
the base tables. I'm concerned that, if I open a free table in a work area
that was occupied by a base table, my changes will not longer be made
in