any sample with browse two database db1, db2 with txbrowse
db1 - main database
nr_:=db1->nr
db2->(dbseek(nr,.f.))
#include 'fivewin.ch'
#include 'xbrowse.ch'
REQUEST DBFCDX
function Main()
OpenData()
BrowseData()
return nil
static function BrowseData
local oDlg, oBrw1, oBrw2, oFont
DEFINE FONT oFont NAME 'TAHOMA' SIZE 0,-12
DEFINE DIALOG oDlg SIZE 640,460 PIXEL FONT oFont
@ 10, 10 XBROWSE oBrw1 ;
COLUMNS 'Code','Name' ;
SIZE 300,100 PIXEL ;
OF oDlg ;
ALIAS 'STATES' ;
CELL LINES
@ 120, 10 XBROWSE oBrw2 ;
COLUMNS 'State', 'City', 'First', 'Salary' ;
SIZE 300,100 PIXEL ;
OF oDlg ;
ALIAS 'CUST' ;
CELL LINES
oBrw1:bChange := { || oBrw2:Refresh() }
oBrw1:CreateFromCode()
oBrw2:CreateFromCode()
ACTIVATE DIALOG oDlg CENTERED ON INIT oBrw1:SetFocus()
RELEASE FONT oFont
return nil
//---------------------------------------------------------
static function OpenData
FIELD CODE
CheckIndex() // If sure abt indexes comment out this function call
USE CUSTOMER NEW SHARED ALIAS CUST VIA 'DBFCDX'
SET ORDER TO TAG STATE
GO TOP
USE STATES NEW SHARED VIA 'DBFCDX'
SET RELATION TO CODE INTO CUST SCOPED
GO TOP
return nil
static function CheckIndex()
FIELD STATE
USE CUSTOMER NEW EXCLUSIVE VIA 'DBFCDX'
If !( OrdNumber( 'STATE' ) > 0 .and. Upper( OrdKey( 'STATE' ) ) == 'STATE' )
INDEX ON STATE TAG STATE
endif
CUSTOMER->( DbCloseArea() )
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 50 guests