Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: FIC Request

$
0
0
Re: FIC Request
FoxInCloud
Re: FIC Request
07/05/2012
07:27:39 AM
3JJ0FZP2T Show this entire thread in new window
Gratar Image based on email address
From:
Patrick
To:
LLS 
Attachments:
None
Currently in my LAN app when the user logs in I connect to MSSQL and get a connection ID that is accessable to all forms, programs,cursor adaptors, ... through the life of the app. I store that to _screen.oData.iConn.

So when running in web mode that will be one connection shared by all users? Is that the suggested way to have a connection or should it be per user or per form/program/ca/...?


Hi Patrick,

Only properties modified by several methods of the form or form objects, are to be reported in thisform.wcPropSave or thisform.myObject.wcPropSave. The other properties do not need to be declared in wcPropSave.

ex:
the ID of the connection must be available to all methods that use the form SQLEXEC () .. This identifier can be stored in a form property. This property must be declared in the list of properties 'thisform.wcPropSave' that FIC will backup and restore when processing HTTP requests. Alternatively, this identifier can be stored in a property of _SCREEN, if the ODBC connection is shared.

Regards



I often do this in my app. Pull some data, ask the user something, update the data.

If I adapt this code to a Call back method will the "cursor1" be available in my Call Back method?

If yes, can I create a cursor to make vars available in my Call back methods (instead of storing them to form and setting .wcPropSave) ?
If no, I am in trouble.

SQLEXEC(iConn,"Select var1, var2, var3 from table1","cursor1") IF messagebox("Do something?",36,"") = 6 SQLEXEC(iConn,"Update table1 set var3 = 'xxx' where var1 = ?cursor1.var1") ENDIF


Adding a property to the form is the easiest workaround.
Make sure this property is listed in .wcPropSave
Another FoxInCloud developer, Luc Gilot, is developing a class allowing to save some context variables across multiple modal callbacks.
I let him know this thread


Would it make sense to have an addition optional parameter for wMessgebox()?

thisForm.wMessageBox (CallBack, eMessageText [, nDialogBoxType ][, cTitleBarText][, nTimeout][,oVars])

Then have in the wFormCallBack()

LPARAMETERS luUserChoice, loVars

I am finding when I am moving my code into wFormCallBack methods there are variables initialed earlier in the original procedure that I need access to. Being able to pass an object containing my variables would be nice.

What is the suggested way to store them currently? Adding a property on the form?





Viewing all articles
Browse latest Browse all 10393

Trending Articles