>In this case, it matters because the dbc() function returns a correct value when the datasession is #4 but as soon as the datasssion is switched to #1 dbc() returns ''. This was all brought on by some tables that did not close correctly in a form. [ I did a select on a table not in the dataenvironment] and when the form closed the tables remained open in a private datasession. This caused the repair function not to work correctly and in trying to find out what was happening I ran into the problem with dbc() described above. I am perfectly happy in fixing the problem and moving on, but my anal associate wants to know WHY this happens.
Make sure in your methods where you may have a SET DATASESSION TO some_number, that you also SET the DATASESSION back to what is was. Store the value of SET("DATASESSION") to a variable before you execute the SET DATASESSION TO # command. Also, the SET DATABASE command is scoped to each data session.
Mark McCasland
Midlothian, TX USA