Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I create a private datasession programmatically?
Message
From
17/11/1998 15:51:53
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
How do I create a private datasession programmatically?
Miscellaneous
Thread ID:
00158496
Message ID:
00158496
Views:
58
I have a FoxPro 2.6 app which I am converting to Visual FoxPro 3.0. At several points in the app, the code is creating a view from the FoxPro environment [using the CREATE VIEW (tempview) command]. The code then closes all databases, opens some tables, creates several cursors, and does various file and data manipulations. When it is done, it closes all the databases and cursors it had opened, sets the view to the stored view [using the SET VIEW TO (tempview) command], which effectively destroys the cursors and restores the FoxPro environment, and erases the .VUE file.

This chunk of code is just SCREAMING for a private data session. If I was doing this in a form, it would be no problem to set the DataSession property to Private. However, this is all running in a .PRG which is called from a Click method in a form. This form also calls several other programs, all of which would need their own data session.

Is there any way to define a private data session through code, select this data session, do whatever needs to be done, then deselect and destroy this private data session? I looked in the Universal Thread Knowledge Base, but could not find a solution.

If it can't be done, I suppose I could continue using the stored environment, but this would be a really neat trick, not to mention incredibly useful in other programs.

Bill Yater
Next
Reply
Map
View

Click here to load this message in the networking platform