Code: Select all
oRs:bOnChangePage = { || vsay := alltrim(STR(oRs:nCurrentPage))+" / "+alltrim( STR(oRs:nMaxPages)),;
oSay:refresh(),oBrw:Refresh() }
Code: Select all
oRs:bOnChangePage = { || vsay := alltrim(STR(oRs:nCurrentPage))+" / "+alltrim( STR(oRs:nMaxPages)),;
oSay:refresh(),oBrw:Refresh() }
Code: Select all
oRs:lAutoPage := .t.
Code: Select all
oRs:lAutoExpand := .t.
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 )
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