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

can a cursor be visible to other forms ? 2

Status
Not open for further replies.

vj

Programmer
Nov 18, 2000
58
MU
hi everyone,

i have created a cursor in a form ... i process data and populate the cursor with the processed data .. now i press on a button which brings up another form .. now is there a way to have that cursor from the previous form visible to this new form ? how is it possible to have a cursor from one form visible to another form ... ?

thankx alot
vijay
 
Set the secondary form to default datasession instead of private datasession.

It's less simple, if you already use private datasessions to separate the sessions and be able to reuse the same tables with same alias names using the same code on differently positioned record, eg by id.

Other possible solutions: Passing on XML created by CURSORTOXML and translate back to a cursor copy via XMLTOCURSOR. Store Cursor via COPY TO to hdd and load that back in the secondary form. If you only need to work on the current record use SCATTER NAME loRecord and pass on the record object. When returning back GATHER the record changes back. All these options are possible with private datasessions.

Bye, Olaf.

 
thankx alot olaf ... setting the form to default datasession helped ...

thankx
vijay
 
Another way to do the same thing would be to create a Temporary data table (a 'real' file) instead of a Cursor (only resident in memory).

That Temporary data table can be created in the almost identical manner that the Cursor is created (Indicies and all) and would be available to anything else (Forms, Queries, etc.) until your application intentionally Deletes it.

Good Luck,
JRB-Bldr
 
hi jrbbldr ,,

thankx for the advice .. but the problem is i dont want to create physical tables on the disk and then latter have them deleted ... i guess it's just a choice of either using & working with cursors or with tables ... i personally like to use and work with cursors.

thankx
vijay
 
JRB-Bldr said:
Another way to do the same thing would be to create a Temporary data table (a 'real' file) instead of a Cursor (only resident in memory).

In general, the only time I'd recommend a table over a cursor is when handing data off to an external process that can't "see" a cursor.

For one thing, the overhead involved in writing to disk is a little expensive in terms of processing time. I'm *living* this right now. One of my predecessors didn't understand cursors so everything went to a temp file. It's all nightmarishly slow -- until I change everything to cursors. It really makes a measurable difference.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top