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

Using cursor in another form

Status
Not open for further replies.

mensud

Programmer
Jul 22, 2001
51
US
Hi,

I have problem with using cursor in form different then it was created.
In start form, I created cursor, and later I am calling another form from this form, and trying to use previously created cursor.
But every time I get message "Alias is not found" or something...
What could be the problem?

Thanks in advance
Mensud
 
Mensud,
If you are using Private Datasessions in your Forms, then you won't be able to (easily) share a cursor, since it can only be seen there. You'll either have to create this as a real table, or you'll have to keep track of the datasession where it's created in a "global" variable and then switch to this datasession when you need to access the data. (Note: MS warns about switching datasessions yourself - it can cause your application/VFP to hang or crash if you don't put everything back the way VFP expects it!)

Rick
 
If the form that is being called uses the Default Data Session, then the cursor should be available as the form will use the datasession of the form that called it.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top