>hi all,
>
>i useto close all
>
>to start my form(main menu),
>
>but if i have any tables with delete records ,the make recall to records.why
>
>this mycode unde,any help,idea.
>
>
>SET TALK off
>SET echo off
>
>CLOSE all
>set delete on
>DO prg
>
>my program prg
>
>SET EXCLUSIVE off
>use mstr in 0
It has been mentioned before, but it is very important that you learn the concept of a Workarea.
FoxPro database commands operate in the current workarea
unless you specify that they be processed in a different workarea by using the
IN command.
USE mstr IN 0 would
usually mean "open mstr in the next available workarea." However, because you have no tables open the "next available workarea" happens to be workarea 1 which also happens to be your current workarea.
What this means is that, despite the use of IN 0, you have actually opened mstr in the current workarea.
>SET EXCLUSIVE off
There's no need to repeat this command. The EXCLUSIVE setting does not pertain to any particular workarea and is still in effect from the last time you issued it.
>use trans1 in 0
>SET EXCLUSIVE off
>use book1 in 0
>SET EXCLUSIVE off
>
>use book2 in 0
>recall all
Are you trying to delete all the records in book2???
If so remember that USE IN 0 means open the table in the next available workarea.
You are not pointing to that workarea. You are still pointed to the first table you opened (mstr).
It is important to realize that commands such as DELETE, REPLACE, RECALL operate in the current workarea unless modified with an IN clause. You must either switch to the desired table or provide an IN clause.
There are three ways you can accomplish what I think you want
1.
SELECT 0
USE book2
RECALL ALL
2.
USE book2 IN 0
SELECT book2
RECALL ALL
3.
USE book2 IN 0
RECALL ALL IN book2
I typically don't use Method 3 unless I have a very good reason and I recommend you avoid that style until you have a great deal more experience with FoxPro.
There is no real difference between Methods 1 and 2. I typically use Method 1, but that's a habit.
>*zap
>
>SET EXCLUSIVE off
>use temp in 0
>delete all
>
>SET EXCLUSIVE off
>use customer in 0
>recall all
>
>SET EXCLUSIVE off
>use arver in 0
>recall all
>
>
Because you never actually switched to the newly opened tables, all of the DELETE and RECALL commands have operated in mstr.
>thanks.
>m.qasem