Re: paging

From: Anders Altberg (x_pragma_at_telia.com)
Date: 08/23/04

  • Next message: Anders Altberg: "Re: paging"
    Date: Mon, 23 Aug 2004 20:52:59 +0200
    
    

    "[VFP] can only order after it has the full resultset." Ever heard of
    Rushmore? <g>.
    -Anders

    "Olaf Doschke" <T2xhZi5Eb3NjaGtlQFNldG1pY3MuZGU@strconv.14> wrote in message
    news:eH8G2JTiEHA.3928@TK2MSFTNGP11.phx.gbl...
    > > select generateKey() as NewKey, * from table
    > > where cCondition
    > > order by cOrder
    > > group by cGroup
    > > having between ( NewKey, FirstRecordOfPage,
    > > FirstRecordofPage+ItemsPerPage )
    > Well, foxpro would work with such a select,
    > but using Having, will filter _after_ the resultset
    > is loaded over the (Ether)net, which is one
    > disadvantage.
    >
    > Nevertheless:
    > You just need generateKey() to be a known
    > function in the scope of the select, which could
    > be globally done with a
    > SET PROCEDURE TO Yourfunctions.prg
    > somewhere at the beginning of an app.
    >
    > But my test shows: Order By is done late,
    > after generateKey() has already generated
    > the same Recno() already gave us...
    >
    > Well foxpro is no database server, it's a file
    > based database. So it can only order after
    > it has the full resultset. A real db server would
    > do the same, but only send the first record
    > over the net, when it has finished with ordering...
    >
    > One solution could be: Having an index with
    > the sorting order you need, use this kind
    > of pseudocode:
    >
    > create cursor resultcursor
    > select 0
    > use table in 0 order tagname
    > locate .t. (faster than go top)
    > skip nPages*nPagelength
    > nCount = 0
    > scan rest
    > if nCount>=nPagelength
    > exit
    > else
    > <copyrecord to resultcursor>
    > endif
    >
    > nCount = nCount +1
    > endscan
    >
    > a copy of a single record can be done
    > with scatter/gather.
    >
    > skip nPages*nPagelength is risky!
    > You'd have to make sure, this wont
    > skip too far (reccount() may help, but
    > it counts deleted records too!).
    >
    > This is complicated, but the way to go
    > with a file based database. I think it's the
    > reason, why something like LIMIT isn't
    > implemented in Foxpro, and why you
    > don't see something like paging in foxpro
    > desktop applications.
    >
    > web applications are another thing: There
    > it would be okay to first select all and then
    > create a html page with a certain
    > "data page"...
    >
    > Bye, Olaf.
    >
    >


  • Next message: Anders Altberg: "Re: paging"

    Relevant Pages

    • Re: Word mail merge with foxpro
      ... > I am trying to connect to a dbf fine not the database. ... >> I do not think you will be able to open a .dbc using ODBC by selecting ... >> using that approach (in the Select Data Source dialog, ... >>> Firstly the files of type drop down does not give a foxpro option. ...
      (microsoft.public.word.mailmerge.fields)
    • Re: Access 2000 run-time error 80004005 - HELP
      ... try changing the column definition (make a backup of the ... > destination table is a linked table originating from a FoxPro v3 database. ... it appears MS is letting FoxPro die a slow death. ...
      (microsoft.public.fox.programmer.exchange)
    • Re: Access 2000 run-time error 80004005 - HELP
      ... You could get the VFPOLEDB driver instead. ... I think Acess 2000 can use an OLE DB connection - it least programmatically. ... > destination table is a linked table originating from a FoxPro v3 database. ...
      (microsoft.public.fox.programmer.exchange)
    • Re: Need to open Visual Fox Pro 8 tables in VB6
      ... There are several formats of Visual FoxPro files. ... VFP6 and below are readable via ODBC. ... "database container". ... Data Sources. ...
      (microsoft.public.vb.database.dao)
    • Re: Database Connection
      ... Database Software: FoxPro 7 ... I installed the VFPOLEDB.DLL for FoxPro 8. ... No error information available: REGDB_E_CLASSNOTREG. ... Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior ...
      (microsoft.public.dotnet.framework.aspnet)