Hi,
I'm trying to rewrite one appl. from dbfs to mysql db . The first problem is to restore clients directed column sequence . That is at first was "order_id,item_id", but client moved columns "item_id,order_id" . Working with dbfs I used Hernans wbrowse class adopted for mine needs . Then I could create array for codeblocks in needfuls sequence and oBrw:bLine := { || brw_line( aFlds) } works fine ...
OK , let say that I retored needful sequence columns for client . From MySql server query I can to do :
aDgr := grd_set( cTbl, aGrd, cLg ) // restore settings of columns - sequence , width , visible ... etc.
cFld := aDgr[ 1, 1 ];
cSql := "select " + cFld + " from " + cTbl + " where " + cTbl + ".db = '" + cDb_id + "'"
oQry := oServ:Query( cSql )
Now begin to describe xBrowse :
aFld := aDgr[ 2 ] // fields in needfuls sequence ...
oBrw := TXBrowse():New( oWnd )
oBrw:SetMySQL( @oQry )
for u := 1 to len( aFld )
oCol := oBrw:AddCol()
oCol:bStrData := { ||oQry:aFld[ u ] }
...
next
Here I stoped . I didn't tried this yet , because I'm in doubt . Question : will this oCol:bStrData := { ||oQry:aFld[ u ] } work ? If not , how can this be done ?
Thanks in advance ! Rimantas