Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Switching DataSession's
Message
From
13/12/2004 13:17:06
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
13/12/2004 13:00:44
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00968641
Message ID:
00968828
Views:
8
Gunnar,
I didn't expect it to change the data session. It's already in that session. Only wanted to note &CommandDS was wrong. You could test this way:
if Type("_screen.ActiveForm") = "O" and !isnull(_screen.ActiveForm)
 if _screen.ActiveForm.Datasession = 2 && Private
    set datasession to _screen.DataSessionID
    _screen.Print('Screen'+trans(set("DataSession"))+chr(13))
    set DataSession to _screen.ActiveForm.DatasessionId
    _screen.Print('ActiveForm'+trans(set("DataSession"))+chr(13))
    set DataSession to
    _screen.Print('Current'+trans(set("DataSession"))+chr(13))
 endif
endif
Cetin

>Hello Cetin
>
>hmm, didn't know that about the error on ds. but sorry, still doesn't work. i tryied your 2 suggestions and even hardcoded for testing purpose the ds id - no effect, the command does not switch the ds.
>
>
>>
>>Gunnar,
>>Sorry couldn't read the whole thread and don't know if you already checked this. The macro substition there looks like as the culprit. Set datasession doesn't error with macro substition even if it was something erroneous ie: DummyVariable is not defined and:
>>set datasession to &DummyVariable
>>doesn't error and doesn't do anything (as if you did "set datasession to")
>>
>>
if Type("_screen.ActiveForm") = "O"
>>	CurrentDS	= set("datasession")
>>	CallingFormDS	= _screen.ActiveForm.DatasessionId
>>	if CallingFormDS <> CurrentDS
>>		ResetDS = .t.
>>		set datasession to CallingFormDS
>>* or
>>		set datasession to _screen.ActiveForm.DatasessionId
>>	endif
>>endif
>>Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform