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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

alias not found even if table is in DE

Status
Not open for further replies.

R17

Programmer
Joined
Jan 20, 2003
Messages
267
Location
PH

i have a textbox with a keypress event, i use table "empRef". actually empRef is the employee table but i change the alias name to "empRef".

why am i having an "alias not found" when i try to select the table? i placed this table in the DE.

what's wrong?
 
are you opening the table with the alias empref?

eg:

use employee again alias empref

 


hi,

instead of putting the same employee table in DE, i just did some sql so select all record and save it into a cursor.

 
Hi R17,

When the SELECTS do not return any records, the cursor gets never opened. To avoid such a situation, you can do it..

1. Create a Form property.. cEmp and initialise the value to "" .i.e. none.

2. Just modify your SQL select as...

ThisForm.cEmp = SYS(3)
SELECT ..... INTO DBF (ThisForm.cEmp)
USE
USE (ThisForm.cEmp) IN 0 ALIAS empRef


3. Now your form will work perfectly..
To clean up the DBF you have created... add in your forms DESTROY event..

DODEFAULT()
ERASE (ThisForm.cEmp+"*.*")

:-)

____________________________________________
ramani - (Subramanian.G) :-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top