I'm on my first project using MariaDB, I'm also using FWMaria for access.
I'm not able to change the order of the data
I start like this:
- Code: Select all Expand view RUN
- oRs := oServer:RowSet( "SELECT nome,r_social FROM agenda ORDER BY r_social" )
XBrowse looks like this:
- Code: Select all Expand view RUN
@ 0069,0000 XBROWSE oBrwAGENDA OF oDlgAGENDA SIZE 0520,0230 STYLE FLAT PIXEL NOBORDER DATASOURCE oRS//AUTOSORT
ADD TO oBrwAGENDA DATA oRs:r_social PICTURE "@!" HEADER "Razão Social" WIDTH 520
ADD TO oBrwAGENDA DATA oRs:nome PICTURE "@!" HEADER "Nome" WIDTH 520
oBrwAGENDA:nColDividerStyle := 0
oBrwAGENDA:nRowDividerStyle := 0
oBrwAGENDA:nMarqueeStyle := 5
oBrwAGENDA:lHScroll := .F.
oBrwAGENDA:lVScroll := .T.
oBrwAGENDA:lRecordSelector := .F.
oBrwAGENDA:bKeyChar := {|nKey|IIF(nKey==VK_RETURN,((OPERACAO_AGENDA(2))),)}
oBrwAGENDA:bClrSelFocus := {||{nRGB(000,000,000),nRGB(150,150,150)}}
oBrwAGENDA:bClrSel := {||{nRGB(000,000,000),nRGB(150,150,150)}}
oBrwAGENDA:bClrStd := {||{CLR_BLUE,IIF(oRS:KeyNo() %2==0,CLR_WHITE,nRGB(232,232,232))}}
oBrwAGENDA:nHeaderHeight := 40
oBrwAGENDA:bClrHeader := {||{nRGB(000,000,000),nRGB(150,150,150)}}
oBrwAGENDA:bSeek := {|c|.F.}
oBrwAGENDA:aCols[1]:oHeaderFont := ARIAL16B
oBrwAGENDA:aCols[1]:bLClickHeader := {|r,c,f,o| nil}
oBrwAGENDA:aCols[2]:oHeaderFont := ARIAL16B
oBrwAGENDA:CreateFromCode()
And I change the order like this:
- Code: Select all Expand view RUN
IF nORDEM == 1
oRs := oServer:RowSet( "SELECT nome,r_social FROM agenda ORDER BY r_social" )
ELSEIF nORDEM == 2
oRs := oServer:RowSet( "SELECT nome,r_social FROM agenda ORDER BY nome" )
ENDIF
oBrwAGENDA:REFRESH()
It turns out that when I start, it loads the data correctly, when I change the order it loads only the first record and multiplies it several times showing in xBrowse.
Where am I going wrong?
Thank you all