I have a form that has 4pages, three of these pages uses the cursor initialized in the procedure init… is it ok to use three different cursor in the three pages? (The cursor used by the three pages content are just names…) thanks in advanced…
Once you have created a cursor, you can use it anywhere you like. It will be available in any form, or on any page of a pageframe, for as long as the cursor is open. You don't need to do anything special to achieve that.
(One exception to the above: you can only use the cursor in the data session in which it is created. But I doubt if that will be an issue for you, Mandy.)
And, yes, you can have three different cursors open at the same time - provided, of course, that they have different names.
Does that answer your question?
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Yes Mike you have answered my question… i have asked this because sometimes i receive an error “cannot access cursor…” since i cannot locate what could be the error… so im thinking of separate cursors… thanks Mike…
Yes Tamar that's what I'm thinking too... but in my application I didn't see closing of the cursor... maybe I have just overlooked it... I'll still try to find where in the code I have closed the cursor.... Thank Tamar...
It's easy to overlook that opening another table can close a table or cursor of the currently selected workarea. Which means, it can be an code that opens another table that accidentally closes the cursor the control still needs.
If you create a cursor in the Activate or Init event of a page, for example, you redo it again and again, and reusing the name would also be a reason you close the cursor at the same time you recreate it.
That's also the tricky part about repeated parts of a form UI, if you have a combobox for picking from a list stored in a table, for example, and need it in several places on a form, on several pages of a pageframe, using the same name means you also have the same selected record in all of them once a user picks an item in one of the comboboxes. To have separate picks you also need separate cursor names.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.