Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Private DataSession Blues
Message
From
27/12/1999 10:45:30
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00308757
Message ID:
00308775
Views:
16
I was using the dataenvironment to set the location to the tables so NewKey would just use the Keys.dbf that was loaded in the forms datasession. I'll just code NewKey so that it gets the same location info from the registry as to where the tables are instead of using the forms privatedatasession. This should take care of the problem I think. After reading your responce and Mikes I think that this is the course to take...



>John,
>
>The real question is why does your NewKey mehtod need to know what data session is runnign in the form. Just code it so it returns the new key and let the form method that called it put the key in the table.
>
>If you absolutely need thte form's data session then pass it as an argument;
>
>oApp.NewKey(cTableName,Thisform.DataSessionID)
>
>In the NewKey method you can;
>
>
>LPARAMETERS pcTable,pnDataSession
>LOCAL lnDataSession
>lnDataSession = TheDataSessionThatThisObjectIsCurrentlyIn
>
>SET DATASESSION TO (pnDataSession)
>
>* Do your sutff
>
>SET DATASESSION TO (lnDataSession)
>
>
>
>The important thign here is to restore the data session when you are done. Not restoring can cause phatom data sessions to left in memeory after all of your forms are gone.
>
>It is a much better design approach to make the NewKey method independent of the data session though.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform