I'd like to help but the construct made no sense.
SELECT 0
SELECT * FROM ALIAS()
Huh?? First off, SELECT 0 changes the work area to one where a cursor is not open. Craig pointed this out.
Now, if the first line was SELECT SELECT() it might make a bit more sense.
This is only a simple repro code for fire the Open Dialog.
So, explain further and maybe I can help: Why is this an issue?
It is very simple:
Perfect programs not exists.
If the program is perfect with any measure instrumentations
- testing
- debugging
- retestig
- release beta 1, beta 2 , ... beta n
- call the top world guru
- read all the books
- prayer recites one
the situation not change, it is true for the past and the present.
Then:
program is not perfect because the conditioned probability of one future error is not zero.
A simple example:
- write a complex program with timers ( with multithread the situation is more clear )
- on the default dir you have two tables
tableA
tableB
with STRUCTURE(tableA)=STRUCTURE(tableB) AND INFORMATION(tableA)<>INFORMATION(tableB).
I known the Open Dialog problem,
then write this defensive code:
USE tableA ALIAS myCursor
.....
SELECT myCursor
SELECT * FROM myCursor WHERE lcondition INTO ARRAY aBank
After two months the customer call me:
"Hello, incompetent, your application have destroy by bank information!"
John, you can explains to me as I make to find the error?
I want implement a NORMAL defensive code ( like defensive is the CPU/OS exception traps)
on my program, like any good program:
try
catch
endtry
You have write recently su XP SP2, and the new NX CPU flag.
NX is a defensive status for buffer overrun.
If the programs and the O/S are perfects,
and any write operation is checked for buffer overrun,
NX is not necessary.
I hope you have catch the problem.
This is not a simple behaviour for lazy programmers,
it is the first rule of programmation:
i must have the control of exceptions
If this is not clear, with my bad english i try to found other examples for you.
Fabio