how to use input from html page

hi
i want to put all data into dbf through my browser how could it be done in visual foxpro.
br
aamir



Answer this question

how to use input from html page

  • Katie Owens

    I think you need to provide a bit more data on this.  Is the database that you are trying to enter into on the web server.  Or are you trying to do this on a local database on the client

  • sharp123

     IbneRasheed wrote:
    hi
    i want to put all data into dbf through my browser how could it be done in visual foxpro.
    br
    aamir

    Francly speaking, very simple:


    m.lcmoneyweb='http://mwprices.ft.com/custom/ft-com/html-currency-summary.asp view=currency-convert&symbols=FOREXR:GBPUS+FOREXR:USDUS+GBP|USD|225'

    ox=CREATEOBJECT("Shell.Explorer")

    CREATE CURSOR xtemp (mtemp m)
    APPEND BLANK
    REPLACE mtemp WITH ReadURL( m.lcmoneyweb)

     



    So, you have your HTML page in memo field...
    But what will you do next


  • Kurt Matthies

    Take a look at ActiveVFP. It uses interop with ASP.NET yet you code everything in VFP. This is a free, Open Source tool that combines all the best practices for using vfp mtdlls and is very simple to use.  VFP mtdlls are ideal for web usage since they're multi-threaded.  You'd need VFP 6SP5, 7SP1, 8, or 9.

  • Aroneous

    And the most important procedure: ReadURL
    (unfortunately I do not remember who did send it to me many years ago):



    *
    * Grab context from Internet
    *
    PROCEDURE READURL
    LPARAMETERS pcUrlName
    DECLARE INTEGER InternetOpen IN wininet.DLL STRING sAgent, ;
          INTEGER lAccessType, STRING sProxyName, ;
          STRING sProxyBypass, INTEGER lFlags

    DECLARE INTEGER InternetOpenUrl IN wininet.DLL ;
       INTEGER hInternetSession, STRING sUrl, STRING sHeaders, ;
       INTEGER lHeadersLength, INTEGER lFlags, INTEGER lContext

    DECLARE INTEGER InternetReadFile IN wininet.DLL INTEGER hfile, ;
          STRING @sBuffer, INTEGER lNumberofBytesToRead, INTEGER @lBytesRead

    DECLARE short InternetCloseHandle IN wininet.DLL INTEGER hInst

    #DEFINE INTERNET_OPEN_TYPE_PRECONFIG 0
    #DEFINE INTERNET_OPEN_TYPE_DIRECT 1
    #DEFINE INTERNET_OPEN_TYPE_PROXY 3
    #DEFINE SYNCHRONOUS 0
    #DEFINE INTERNET_FLAG_RELOAD 2147483648
    #DEFINE CR CHR(13)

    local lsAgent, lhInternetSession, lhUrlFile, llOk, lnOk, lcRetVal, lcReadBuffer, lnBytesRead

    * what application is using Internet services
    lsAgent = "VPF 5.0"

    lhInternetSession = InternetOpen( lsAgent, INTERNET_OPEN_TYPE_PRECONFIG, ;
          '', '', SYNCHRONOUS)

    * debugging line - uncomment to see session handle
    * WAIT WINDOW "Internet session handle: " + LTRIM(STR(hInternetSession))

    IF lhInternetSession = 0
       WAIT WINDOW "Internet session cannot be established" TIME 2
       RETURN .null.
    ENDIF

    lhUrlFile = InternetOpenUrl( lhInternetSession, pcUrlName, '', 0, ;
                                 INTERNET_FLAG_RELOAD, 0)

    * debugging line - uncomment to see URL handle
    * WAIT WINDOW "URL Handle: " + LTRIM(STR(hUrlFile))

    IF lhUrlFile = 0
       WAIT WINDOW "URL cannot be opened"
       RETURN .null.
    ENDIF

    lcRetVal = ""
    llOk = .t.

    DO WHILE llOK
       * set aside a big buffer
       lsReadBuffer = SPACE(32767)
       lnBytesRead = 0
       lnOK = InternetReadFile( lhUrlFile, @lsReadBuffer, LEN(lsReadBuffer), @lnBytesRead)

       if ( lnBytesRead > 0 )
          lcRetVal = lcRetVal + left( lsReadBuffer, lnBytesRead )
       endif

       * error trap - either a read failure or read past eof()
       llOk = ( lnOK = 1 ) and ( lnBytesRead > 0 )
    ENDDO

    * close all the handles we opened
    InternetCloseHandle( lhUrlFile )
    InternetCloseHandle( lhInternetSession )

    * return the URL contents
    RETURN lcRetVal

     


  • Jigang

    There are a few ways to do this, but our recommended way is to use ASP.NET and on the server, have the ASP.NET code call into the VFP data either via .NET/COM interop via a VFP COM DLL or go directly to the VFP data via the VFP OLE DB provider.

  • how to use input from html page