FWH: MySql/MariaDB: RowSet object

luiz53
Posts: 43
Joined: Fri Jun 01, 2007 12:41 pm
Contact:

Re: FWH: MySql/MariaDB: RowSet object

Post by luiz53 »

CHANGE LINE 35 TO

Code: Select all

   oRs:bOnChangePage = { || vsay := alltrim(STR(oRs:nCurrentPage))+" / "+alltrim( STR(oRs:nMaxPages)),;
                            oSay:refresh(),oBrw:Refresh() }
 
luiz53
Posts: 43
Joined: Fri Jun 01, 2007 12:41 pm
Contact:

Re: FWH: MySql/MariaDB: RowSet object

Post by luiz53 »

MR Rao...

OLD - Don´t work key down or key UP

Code: Select all

oRs:lAutoPage     := .t.
 
NEW - BUT don´t work oRs:bOnChangePage with key down or key UP

Code: Select all

oRs:lAutoExpand   := .t.
 

https://www.youtube.com/watch?v=DgP54iw ... e=youtu.be
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: FWH: MySql/MariaDB: RowSet object

Post by nageswaragunupudi »

In your dolphin example also pressing down arrow key does not go to next page. I sent you a sample which works exactly like your sample.
Note: Personally I do not like this kind of paging.

I prefer this
http://forums.fivetechsupport.com/viewt ... on#p199916
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: FWH: MySql/MariaDB: RowSet object

Post by nageswaragunupudi »

Dynamically changing fields, [table], [connection] of a Rowset at runtime and also change the XBrowse:

This is possible from FWH 18.05:

Code: Select all

oRs := oCn:RowSet( cSql )
// set up browse 
// during runtime
//

oRs:oCn := oNewCn // Optional
oRs:ReQuery( cNewSql ) // same or different table
oRs:SetXbrColumns( oBrw )
 
Sample:

Code: Select all

#include "fivewin.ch"

function Main()

   local oCn, oRs, oDlg, oBrw
   local aSql  := {  "select id,first,city, salary from customer", ;
                     "select * from states", ;
                     "select * from annual" }

   oCn   := FW_DemoDB()
   oRs   := oCn:RowSet( aSql[ 1 ] )

   DEFINE DIALOG oDlg SIZE 600,400 PIXEL TRUEPIXEL ;
      TITLE "SWITCH TABLES/FIELDS AT RUNTIME"

   @ 60, 20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE oRs AUTOCOLS CELL LINES NOBORDER
   oBrw:CreateFromCode()

   @ 20, 20 BTNBMP PROMPT "CUSTOMER" ;
      SIZE 100,35 PIXEL OF oDlg FLAT ;
      ACTION ( CursorWait(), oRs:Requery( aSql[ 1 ] ), oRs:SetXbrColumns( oBrw ) )

   @ 20,140 BTNBMP PROMPT "STATES" ;
      SIZE 100,35 PIXEL OF oDlg FLAT ;
      ACTION ( CursorWait(), oRs:Requery( aSql[ 2 ] ), oRs:SetXbrColumns( oBrw ) )

   @ 20,260 BTNBMP PROMPT "ANNUAL" ;
      SIZE 100,35 PIXEL OF oDlg FLAT ;
      ACTION ( CursorWait(), oRs:Requery( aSql[ 3 ] ), oRs:SetXbrColumns( oBrw ) )

   ACTIVATE DIALOG oDlg CENTERED

   oCn:Close()

return nil
 
Image
Regards

G. N. Rao.
Hyderabad, India
Post Reply