Tsibert,
Welcome to the forum. Dan has given you some good advice about data sessions. I'll just add a couple of points.
As Dan said, each work area can host at most one table. Or, put another way, each table is opened in a separate work area. (It is possible to open a table in multiple work areas at the same time, but I assume that's not what you want to do, so we'll pass over that.)
Now, work areas are numbered from 1 to some high number. When you open a table, you can explicitly select the work area you want to open it in. For example, you could execute these commands:
[tt]SELECT 5
USE Clients[/tt]
That would open the client table in work area 5. In practice, it doesn't make much sense to do that. It would mean that you would have to remember which table was open in which numbered work area, and take great care to ensure you don't try to open another table in the same area.
So, a better solution is to do this:
[tt]USE Clients IN 0[/tt]
The [tt]IN 0[/tt] clause essentially means "whichever is the next available work area". So if you had already opened two tables, the above command would open Clients in Work Area 3. But you wouldn't need to know that. You can just refer to the work area as Clients from that point on. For example:
[tt]USE Products IN 0
USE Orders IN 0
USE Clients IN 0
USE Invoices IN 0
* Four tables are now open
* Do some stuff here with various tables
* Now do something with the Clients table
SELECT Clients
REPLACE ...... && or whatever you want to do
[/tt]
Now, everything I've said above re tables also applies to views. Essentially, you open a view just like you open a table. You open it in its own work area, and the same rules apply. (I'm assuming you are using the term View in the sense of a result set produced by a query, rather than a .VUE file or the View window mentioned by Dan above.)
The above is a slight over-simplification, but if you get the hang of what I have written, you will have made a good start.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro articles, tips and downloads