Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataSession troubles.
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00457954
Message ID:
00457961
Views:
24
>Here is an outline of the code:
>
>
Function CallMe (part of our standard procedure)
>Parameter tcEmpno
>Local lnDS, lnNewDS, lcCallMe
>
><b>lnDS = set('datasession')
>lnNewDS = createobject('session')
>set datasession to lnNewDS.datasessionid</b>
>
>select 0
>use people order empno
>seek tcEmpno
>if found()
>  lcCallMe=iif(empty(termdate),'','*')+trim(callname)+' '+empname
>else
>  lcCallMe=''
>endif
>
><b>release lnNewDS
>set datasession to (lnDS)</b>
>
>return lcCallMe
>
>The errors that we get:
>- Using CallMe() in a form: ‘Cannot access selected table’. Callme() used in the refresh of 2 textboxes. Error pops up while skipping back and forth, it is related to the speed of clicks on the next/previous. Dbf() returns ‘people’ every time the error occurs…
>- Using CallMe() in a report called from a form – Invalid page fault in VFP

What Nadya said about LOOKUP(), but one of your problems here may be that SET EXCLUSIVE is scoped to the DataSession (see the help under SET DATASESSION for a full list of commands.

(Do you want to call the variable loNewDS, btw?)

Also, you might want to write your search as follows -- mileage may vary, of course.
SELECT 0
USE people SHARED
IF SEEK(tcEmpNo, "people", "empNo")
*!* etc.
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform