Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiple instances of same form
Message
From
23/10/2004 07:21:21
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Multiple instances of same form
Miscellaneous
Thread ID:
00953971
Message ID:
00953971
Views:
63
I have an application that uses ODBC to a MS SQL backend. I need to change the screen forms to allow multiple instances of the same form to be opened at the same time. What I'd like to be able to do is to reference the same cursor name within each instance but not reference the same actual cursor. I have a data engine class that manages the data by request from the requestor and works with a cursor named 'curXXXXXXXX'. The 'XXXXXXXX' is the name of the base table on the data source. For example the program will do a call to SQLEXEC() as:

SQLEXEC(m.lnHandle,'SELECT * FROM Users WHERE UserID = "JWHITE" ORDER BY UserID','curUsers')

This produces a cursor by the name of curUsers with one row for the requested user-id. Now the problem is if I open another instance of the screen form or another form that references curUsers things are going to get trashed. My question is is there a way to control this? I could fabricate a unique cursor name and reference it with a memvar but this gets messy with EVALUATE(), macro substitutions, etc. Is there any way to use the data environment at the form level to do what I want?

Any help would be greatly appreciated.

Jim White
Time is a wonderful teacher. Unfortunately it kills all of its students.
Next
Reply
Map
View

Click here to load this message in the networking platform