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

Cursor loses relation? 2

Status
Not open for further replies.

thatguy

Programmer
Aug 1, 2001
283
US
Hey all..

in VFP6.0, i'm using a combobox with an SQL statement as rowsource and i'm putting the results into a cursor (SELECT ... FROM ... INTO CURSOR curlevels ORDER BY ckey). then i'm setting a relation from the cursor into a table (select curlevels; set relation to curlevels.ckey into scores). i have that relation set in the combobox.init(), but as soon as that event is done, the relation disappears! then i reset it elsewhere, but as soon as i requery the combobox, the relation disappears again. it's to the point that the only way i can keep the relation is to reset it after the requery.

is this just what i have to do? is there some strange cursor or combobox behavior that i don't know about (probably)? any help would be appreciated.

thanks,
-- thatguy~
 
Hi thatguy,
The set relation command require the two tables to be opened in different workareas. And as soon as you issue requery, the cursor is re-created and hence looses the previous relations.

So, as per current VFP scenario, you have to re-establish the relation after requery.
 
As soon as you issue the select statement again, the cursor is removed from memory and replaced with a new one. For the programmer of the same name but internally a different cursor, so therefore not in relation with your table anymore.

HTH,


Weedz (Wietze Veld)
My private project:And especially for VFP rookies:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top