ActiveVFP questions

Aug 21, 2007 at 4:30 PM
Edited Aug 21, 2007 at 6:52 PM
First at all: Claude, congratulations for this great product!

Well, i'm using ActiveVFP (it's my first time with it) and I have some rare situations: sometimes, I get an empty screen in my web explorer; others times, I get a FALSE word. Why?
I call some PRGs from MAIN PRG that returns HTML strings to m.lcHTMLOut MAIN variable. "Empty screen" occurs only the first time that I call PROG1.PRG; next times works OK. FALSE word occurs always that I call PROG2.PRG.

If you need more info in order to help me, please, let me know.

Best regards and thanks in advanced.

VFP9 - W2K SP4

Daniel
Coordinator
Aug 21, 2007 at 6:57 PM
I would say make sure it's always returning HTML - sounds like sometimes it's not returning HTML for some reason. You could try to trap that condition and debug it.

danielcp wrote:
First at all: Claude, congratulations for this great product!

Well, i'm using ActiveVFP (it's my first time with it) and I have some rare situations: sometimes, I get an empty screen in my web explorer; others times, I get a FALSE word. Why?
I call some PRGs from MAIN PRG that returns HTML strings to m.lcHTMLOut MAIN variable. "Empty screen" occurs only the first time that I call PROG1.PRG; next times works OK. FALSE word occurs always that I call PROG2.PRG.

If you need more info in order to help me, please, let me know.

Best regards and thanks in advanced.

VFP9 - W2K SP4

Daniel

Aug 21, 2007 at 7:47 PM
Claude, thanks for your quick answer.
OK, i'm going to make some tests.

One more question: why I must disable Anonymous access in order to debug my WebApplication from EXE file?

One more time, thanks in advance.

Daniel
Coordinator
Aug 21, 2007 at 10:17 PM
The debugging technique requires more permissions than a regular anonymous user has. Should be easy to re-enable it after debugged.

danielcp wrote:
Claude, thanks for your quick answer.
OK, i'm going to make some tests.

One more question: why I must disable Anonymous access in order to debug my WebApplication from EXE file?

One more time, thanks in advance.

Daniel

Aug 30, 2007 at 12:35 PM
Claude, thanks for your help.
My new webapp is working fine.

A new question: how can I set duration of authenticated users?
For example: I enter to my website; put username and password; I do some things and leave my computer on because I want a caffe. When I return, 10 minutes later, I can surfing my site because I'm still logged on.
I want set only 3 minutes of inactivity.

Thanks!

Daniel
Coordinator
Aug 30, 2007 at 7:29 PM
This should do it:

oSession.timeout(14400) && adjust per your requirements in vfp - this is the same as the session timeout in ASP
Mar 4, 2008 at 9:49 AM
Claude,
You wrote
This should do it:

oSession.timeout(14400) && adjust per your requirements in vfp - this is the same as the session timeout in ASP

If I use this in main.prg I get :
main err#= 1734 line= 37 Property TIMEOUT is not found.1734 Property TIMEOUT is not found. TIMEOUT .NULL. .NULL. .NULL. .NULL.

My problem is that I want to give the user more time before they're logged out because they often work on documents. If I set the session timeout to 60 in ASP it works fine locally but on the server it does not, even though the provider set the timeout in IIS.

BTW I really like avfp, check out www.snaap.nl to see what I'm cooking with it.
Coordinator
Mar 5, 2008 at 11:13 AM
Edited Mar 5, 2008 at 11:15 AM
Hmm... it could be as simple as making oSession.timeout into oSession.Timeout with the capital "T". If that's not it, check the proxystub.prg and make sure the session object is defined thusly:
  • Base ActiveVFP Objects
oRequest = THIS.oRequest
oSession = THIS.oSession
oResponse = THIS.oResponse

If all else fails, you should just be able to define this in the default asp script as well since it's the same exact object.

I checked out your site and the design is pretty cool!

stephan33 wrote:
Claude,
You wrote
This should do it:

oSession.timeout(14400) && adjust per your requirements in vfp - this is the same as the session timeout in ASP

If I use this in main.prg I get :
main err#= 1734 line= 37 Property TIMEOUT is not found.1734 Property TIMEOUT is not found. TIMEOUT .NULL. .NULL. .NULL. .NULL.

My problem is that I want to give the user more time before they're logged out because they often work on documents. If I set the session timeout to 60 in ASP it works fine locally but on the server it does not, even though the provider set the timeout in IIS.

BTW I really like avfp, check out www.snaap.nl to see what I'm cooking with it.

Mar 5, 2008 at 5:55 PM
Alas, not that simple....amembers(array,oSession,1) return this:
ADDOBJECT Method
ADDPROPERTY Method
BASECLASS Property
CLASS Property
CLASSLIBRARY Property
COMMENT Property
CONTROLCOUNT Property
CONTROLS Property
DESTROY Event
ERROR Event
HEIGHT Property
HELPCONTEXTID Property
INIT Event
LEFT Property
LOAD Method
NAME Property
NEWOBJECT Method
OBJECTS Property
OSESSION Property
PARENT Property
PARENTCLASS Property
PICTURE Property
READEXPRESSION Method
READMETHOD Method
REMOVEOBJECT Method
RESETTODEFAULT Method
SAVEASCLASS Method
SHOWWHATSTHIS Method
TAG Property
TOP Property
VALUE Method
WHATSTHISHELPID Property
WIDTH Property
WRITEEXPRESSION Method
WRITEMETHOD Method
17
No timeout there to be seen...and as I wrote the webserver throws me out after 20 minutes regardless of DEFAULT.ASP and the provider claiming they changed it in IIS...

Thanks for your reaction anyway, I've made a workaround by calling the app after 15 minutes of non-activity via Javascript.

{quote}
claudefox wrote:
Hmm... it could be as simple as making oSession.timeout into oSession.Timeout with the capital "T". If that's not it, check the proxystub.prg and make sure the session object is defined thusly:
  • Base ActiveVFP Objects
oRequest = THIS.oRequest
oSession = THIS.oSession
oResponse = THIS.oResponse

If all else fails, you should just be able to define this in the default asp script as well since it's the same exact object.

I checked out your site and the design is pretty cool!
Coordinator
Mar 5, 2008 at 10:12 PM
Well that's weird! What's your OS and ASP version? I thought the timeout method was pretty standard in ASP.
I have successfully used oSession.timeout() in main.prg in several projects. Then I could check for a timeout in the application method like this:
lctable=oSession.VALUE("account")
IF ISNULL(lctable) &&Session timed out and lost values
oSession.Value("errormsg","Your session has timed out because of inactivity. Please login again.")
oResponse.Redirect(oProp.ScriptPath)
ENDIF
{quote}
stephan33 wrote:
Alas, not that simple....amembers(array,oSession,1) return this:
ADDOBJECT Method
ADDPROPERTY Method
BASECLASS Property
CLASS Property
CLASSLIBRARY Property
COMMENT Property
CONTROLCOUNT Property
CONTROLS Property
DESTROY Event
ERROR Event
HEIGHT Property
HELPCONTEXTID Property
INIT Event
LEFT Property
LOAD Method
NAME Property
NEWOBJECT Method
OBJECTS Property
OSESSION Property
PARENT Property
PARENTCLASS Property
PICTURE Property
READEXPRESSION Method
READMETHOD Method
REMOVEOBJECT Method
RESETTODEFAULT Method
SAVEASCLASS Method
SHOWWHATSTHIS Method
TAG Property
TOP Property
VALUE Method
WHATSTHISHELPID Property
WIDTH Property
WRITEEXPRESSION Method
WRITEMETHOD Method
17
No timeout there to be seen...and as I wrote the webserver throws me out after 20 minutes regardless of DEFAULT.ASP and the provider claiming they changed it in IIS...

Thanks for your reaction anyway, I've made a workaround by calling the app after 15 minutes of non-activity via Javascript.


claudefox wrote:
Hmm... it could be as simple as making oSession.timeout into oSession.Timeout with the capital "T". If that's not it, check the proxystub.prg and make sure the session object is defined thusly:
  • Base ActiveVFP Objects
oRequest = THIS.oRequest
oSession = THIS.oSession
oResponse = THIS.oResponse

If all else fails, you should just be able to define this in the default asp script as well since it's the same exact object.

I checked out your site and the design is pretty cool!


Mar 6, 2008 at 10:54 AM

claudefox wrote:
Well that's weird! What's your OS and ASP version?

I agree it is weird.
I use Windows XP Professional SP 2, IIS 5.something and ASP 3.0. My workaround with Javascript works well and gives me actually exactly what I want: as long as the user stays on one of my pages, the session is not ended and if he leaves, the session is ended within 20 minutes. So I'm not spending more time on this matter, thank you very much for your help and replies!

Greetings, Stephan
May 6, 2008 at 4:36 PM
Hello all,
I am quite new in this domain and I have an issuse regarding ActiveVFP.
I installed it and it works well but I tried to access a foxpro table from the LAN shared resource and seems that it isn't available. I think that it is mostly a IIS issue not a AVFP one but if anyone could help me would be great.
What I have done:
I added a new type of action on MAIN.PRG like below

CASE oProp.Action=='test'
lcFile="\\LANComputer\shareddocs\myfolder\data\mytable.dbf"
IF ! FILE(lcFile)
lcHTMLout = "Can't find "+lcFile
ELSE
SELE * FROM (lcName) INTO CURSOR tCursor
lcHTMLfile = 'test.htm' && html template
lcHTMLout= FILETOSTR(oProp.HtmlPath+lcHTMLfile)
lcHTMLout= oHTML.htmlTable('CName',lcHTMLout,10,5,'#E5E5E5',.F.;
,VAL(oRequest.querystring("page")),oRequest.querystring("nav"))
lcHTMLout= oHTML.mergetext(lcHTMLout)
ENDIF

but http://localhost/MyApp/default.asp?action=test returns always "Can't find ..."
The rest of the sample works fine.

I have WinXP Professional SP2+ IIS5.1 + the LAN computer has WinXPPro too and I tried all the tricks which I was able to find on the web with no result.
Using the same user (has "Act as part of the operatig system" privilege) I can access these shared resources using php+ADODB or Active FoxPro so the issue seems to be from IIS or somehow from ActiveVFP.
Any help would be great.
Thanks.
Titus
Coordinator
May 9, 2008 at 2:12 PM
Edited May 9, 2008 at 2:13 PM
Titus,
Regarding your new code, there is a bug when you run WebAppBuilder (I think primarily on XP) where it doesn't change the name of the server in default.asp. It is supposed to automatically change to whatever application name you gave it. The simple workaround is to go into default.asp and change the server name from 'AVFPdemo3' to whatever your new mtdll is named.

Regarding accessing data from another LAN drive, you must setup your new mtdll as a COM+ application and assign a user to it with proper access rights. See the docs for simple setup instructions.

One day I'll get around to fixing some of these issues and implementing some upgrades to AVFP (unless someone else here beats me to it .. hint.. nudge..) but I'm working on a major ActiveVFP site right now that is consuming all of my time...


Titus wrote:
Hello all,
I am quite new in this domain and I have an issuse regarding ActiveVFP.
I installed it and it works well but I tried to access a foxpro table from the LAN shared resource and seems that it isn't available. I think that it is mostly a IIS issue not a AVFP one but if anyone could help me would be great.
What I have done:
I added a new type of action on MAIN.PRG like below

CASE oProp.Action=='test'
lcFile="\\LANComputer\shareddocs\myfolder\data\mytable.dbf"
IF ! FILE(lcFile)
lcHTMLout = "Can't find "+lcFile
ELSE
SELE * FROM (lcName) INTO CURSOR tCursor
lcHTMLfile = 'test.htm' && html template
lcHTMLout= FILETOSTR(oProp.HtmlPath+lcHTMLfile)
lcHTMLout= oHTML.htmlTable('CName',lcHTMLout,10,5,'#E5E5E5',.F.;
,VAL(oRequest.querystring("page")),oRequest.querystring("nav"))
lcHTMLout= oHTML.mergetext(lcHTMLout)
ENDIF

but http://localhost/MyApp/default.asp?action=test returns always "Can't find ..."
The rest of the sample works fine.

I have WinXP Professional SP2+ IIS5.1 + the LAN computer has WinXPPro too and I tried all the tricks which I was able to find on the web with no result.
Using the same user (has "Act as part of the operatig system" privilege) I can access these shared resources using php+ADODB or Active FoxPro so the issue seems to be from IIS or somehow from ActiveVFP.
Any help would be great.
Thanks.
Titus