Versão do ActiveVFP para Windows Server 2008 R2

Topics: User Forum
Mar 6, 2013 at 8:45 PM
Goodnight everyone,

I'm using google translator, sorry for any incorrect translation

I would like to take a course with you.

I already have a version of ActiveVFP very old and works perfectly in IIS 6 but IIS is now 7 and my system is experiencing errors Request.

I can rebuild my project in this new version of ActiveVFP 6:03 without having to change the source code?


Fabio Mascarenhas
Mar 6, 2013 at 9:02 PM
6.03 is a more radical change from the older versions. You may want to try 5.53 instead, at least to begin the transition. 5.53 has most of what 6.03 offers but serves it up via the old default.aspx which should be more similar to your older version.

I would advise you to look at some of the new samples. Scripting is primarily in .avfp pages now while your scripts may have been just .htm files and/or main.prg. Rename your .htm files to be .avfp files and, any vfp code you had in your old main.prg, put in the new main.prg (5.53 version). Keep everything else in the 5.53 main.prg the same.

You now are encouraged to do all or most of the coding in the .avfp script files (contains vfp code and html) just like how it's done in PHP. You can have centralized VFP function libraries and classes that will be called the same way from your scripts as is done in normal foxpro (see docs or inline code documentation in the examples).

(Version 6.03 allows the creation of VFP Controllers as an alternative to putting a lot of code in .avfp files)
Mar 8, 2013 at 12:06 AM
First I want to thank the prompt response to my question.

Claude, in the Main.prg my project is set as the Default file for compilation and initiated as follows:

Define Class Server As ActiveVFP OlePublic
Function Main
    OPROP = Newobject('AVFPproperties')
    OHTML = Newobject('AVFPhtml')
    OCOOKIE = Newobject('AVFPcookie')
    OSESSIONTABLE = Newobject('AVFPsessiontable')
    OUPLOAD = Newobject('AVFPhttpUpload')
    If Isnull(OSESSIONTABLE.Value("authenticated"))
        OTOHTML = Createobject("to_html.RpttoHtml")
        LCRETORNO = OTOHTML.VALIDA_INI("Quebra", "Habilita", LCPASTA)
        If LCRETORNO="1"
            LCRETORNO = OTOHTML.VALIDA_INI("Quebra", "Oculta", LCPASTA)
            OTOHTML = .Null.
            If LCRETORNO="1"
            OTOHTML = .Null.
    Do Case
        Case OPROP.ACTION=='listaramais'
            LCR1 = OREQUEST.Form("R1")
            LCCODIGO = OREQUEST.Form("codigo")
            If Empty(LCCODIGO) .Or. Isnull(LCCODIGO)
                LCCODIGO = OSESSIONTABLE.Value("oCodigo")
                OSESSIONTABLE.Value("oCodigo", Padr(LCCODIGO,6," ") )
            LCPAR = OREQUEST.QUERYSTRING("ramal")
        Case OPROP.ACTION=='valida_acesso'
            LCHTMLOUT = This.VALIDA_ACESSO()
        Case OPROP.ACTION=='ramal'
            LCHTMLOUT = This.RAMAL()
        Case OPROP.ACTION=='codigosenha'
            LCHTMLOUT = This.CODIGOSENHA()
        Case OPROP.ACTION=='contadetalhada'

Not found in the Main.prg FONT available for download to have as a basis for study.

My default.asp is in the following form:

Set oServer = Server.CreateObject ("cdweb.server")
Set oServer oServer.GetDebugObject = ()
Response.Write (oServer.Main ())
'Set oServer = nothing

The fact that I would have to change to work in this new version?

Can you give me more tips?
Thanks in advance,

Mar 8, 2013 at 12:41 AM
Edited Mar 8, 2013 at 12:42 AM
Just download AVFP 5.53 and start playing with the examples. You'll have to run the examples and see how they work for yourself. Then you should be able to figure out how to get your existing vfp application code to work fairly rapidly. Once you're comfortable with that, place your existing code in a .AVFP file in the HTML directory and try to get that to work. Don't worry so much about the underlying technology as it should be similar enough to the version you're on to not be a big problem...
Mar 10, 2013 at 4:43 AM
Yeah, agree with Claudefox. As long as the working example is working, and remodify in it, then I would learn it parts by parts easily. Of course, get the simple things works first such as,

html interface code, like radio button, check box, ....

and then comes to vfp code mixing with html display.
Mar 13, 2013 at 10:16 PM
Claudefox, goodnight.

The biggest question about changing the version is by reason of this error:

ServerVariables err # = 1925 line = 1466 Unknown Unknown member OREQUEST.1925 OREQUEST member. OREQUEST. NULL. . NULL. . NULL. . NULL. c: \ atrium \ contadigital \ cdweb \ error cdweb.dll '800a0785 '
c: \ atrium \ contadigital \ cdweb \ cdweb.dll
/ contadigital / Default.asp, line 4

and the program line is:

  • AVFPRequest :: ServerVariables

FUNCTION ServerVariables
RETURN THIS.oRequest.ServerVariables (lcName). Item


If I can not solve this problem need to change the version.

Remembering that my server is Windows Server 2008 R2 with IIS 7.5.

Is it possible?

Fabio Mascarenhas
Mar 14, 2013 at 3:09 AM
You're going to have to debug this yourself. I just don't have the time to go line by line through your code.