Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ALIAS() not changing

Status
Not open for further replies.

aharrisreid

Programmer
Nov 17, 2000
312
0
0
GB
I am having problems with a piece of code which includes the line SELECT MyTable (or MyCursor), but when the line is executed, the current area doesn't move! This of course causes problems with following lines of code which refer to fields which do not exist in the original table/cursor.

This problem is not reproducible to order, and 99% of the time the current area does move to MyTable, but the 1% failure is enough to cause concern.

The networked application is running on FoxPro for DOS 2.6, using the runtime libraries and NT4.

Has anyone else had this problem? Any help would be appreciated.

Many thanks,
Alan Harris-Reid
 
Try using sele 0 (zero) command.
So to open a new table
sele 0
use mytable/mycursore

Sle ct 0 opens next avialable work area.

Alternatively increase the number of files in the config.sys file of the node on which the application is running.
 
If no error (Alias "MyTable" not found),
you have maybe wrong error handler.
Otherwise you may prevent data damage:
sele MyTable
if alias() # "MyTable" .or. dbf() # "MyTable"
* error process
else
* standard process
endif
 
rajarama, thanks for the reply.

>Try using sele 0 (zero) command.
So to open a new table
sele 0
use mytable/mycursore

Sle ct 0 opens next avialable work area.<

Maybe I didn't explain myself well - MyTable is already open, but the program is sometimes behaving as if the SELECT MyTable line doesn't exist at all!

Regards,
Alan
 
tesar, thanks for the reply.

>If no error (Alias &quot;MyTable&quot; not found),
you have maybe wrong error handler.<

I'll check the error handler, because it is not reporting &quot;MyTable not found&quot;. But then again, it shouldn't, because MyTable exists and (according to DISP STAT) it is definitely open!

>sele MyTable
if alias() # &quot;MyTable&quot; .or. dbf() # &quot;MyTable&quot;
* error process
else
* standard process
endif<

This is a good idea. I'll try it and see what happens.

Regards,
Alan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top