FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrouse with SQRDD+Firebir
Posts: 36
Joined: Sat Jun 19, 2010 10:09 AM
xBrouse with SQRDD+Firebir
Posted: Mon Jun 06, 2011 03:00 AM

friends who can help me, I'm using 11.4 and FWH xharbour1.21 sqlrdd + + firebird
I'm having the following problem:
ride browse through the code below, to receive the focus browse duplicates the first record, not showing the table data properly. I tried everything and nothing.

with more normal work with dbf sql sqrdd used commercial and firebird. records to focus on Rebecca xbrowse duplicate the first, and then clicking the first row. qo xbrowse the first time and shown the same thing happens. if they can help me, following my code below:

    dbUseArea( .T., “SQLRDD”, “CONSULTA” )

REDEFINE xBrowse oBrwBuscaItem ID 4002 OF oDlgBuscaItem UPDATE ALIAS "CONSULTA"


oCol:= oBrwBuscaItem:AddCol()
oCol:cHeader            := "Produto"
oCol:bStrData           := {|| CONSULTA->DESCRICAO }
oCol:bRClickData    := {|r,c,f,o| Msginfo("Right click on column data " + o:cHeader, "TXBrowse power") }
oCol:nWidth:=360


oCol:= oBrwBuscaItem:AddCol()
oCol:cHeader            := "Unitário"
oCol:bStrData           := {|| TRANSFORM( CONSULTA->PRVENDA, "@E 99,999.99" ) }
oCol:bRClickData    := {|r,c,f,o| Msginfo("Right click on column data " + o:cHeader, "TXBrowse power") }
oCol:nWidth:=150


    PRODUTOS->( oBrwBuscaItem:SetRDD() ) // not working
   oBrwBuscaItem:Refresh( .T.) // not working
Posts: 59
Joined: Thu May 17, 2007 08:27 AM
Re: xBrouse with SQRDD+Firebir
Posted: Tue Jun 07, 2011 09:26 AM

HI:

I USE xHarbour 1.2x+SQLRDD+fwh .
Xbrowse Work fine in MYSQL or PostgeSQL.

try:
oDlg:oClient := oBrwBuscaItem
oBrwBuscaItem:Refresh()

--
Best Regards


kokoo KAO

-------------

best regards

kokoo Kao
Posts: 36
Joined: Sat Jun 19, 2010 10:09 AM
Re: xBrouse with SQRDD+Firebir
Posted: Tue Jun 07, 2011 10:50 AM

the problem is that when displaying the dialog in xbrowse it's an automatic refresh, doubling the first line of data to browse.

and how to use the posted dbusearea dbf to work well, but with the firebird me this problem occurs, and sometimes it shows more correct when you select the first line of xbrowse it's an automatic refresh and duplicates the first row.

if the table has 10 record and the first record is for example "Hansel and Gretel, " and he takes that first equal on all lines generating 10 equal lines, which should not occur if you have a solution thanks.

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrouse with SQRDD+Firebir
Posted: Tue Jun 07, 2011 11:07 AM
Please try this simple code and let us know if this works. Please also post a screen shot.

Code (fw): Select all Collapse
XbrNumFormat( "E", .t. )

dbUseArea( .T., “SQLRDD”, “CONSULTA” )

REDEFINE xBrowse oBrwBuscaItem ID 4002 OF oDlgBuscaItem ;
COLUMNS "DESCRICAO", "PRVENDA" ;
HEADERS "Produto", "Unitario" ;
SIZES 360, 150 ;
ALIAS "CONSULTA" CELL LINES

ACTIVATE DIALOG oDlgBuscaItem

Please also do not add any other code for xbrowse now.

Please also let us know if the following functions work in SQLRDD or not
1. OrdKeyCount()
2. OrdKeyGoTo()
3. OrdKeyPos()
If these functions do not work like in DBFCDX, we need to change the navigation codeblocks.
Regards



G. N. Rao.

Hyderabad, India
Posts: 36
Joined: Sat Jun 19, 2010 10:09 AM
Re: xBrouse with SQRDD+Firebir
Posted: Tue Jun 07, 2011 10:50 PM

The problem that the first ride with the xbrowse dbusearea simple as below. ride all normal columns. need to do more then a select on the table,
and the alias is returned by the function which returns at a lower dbusearea data with select.

ie when I run this function, alas, while the parameters to sql instruncao, and alias that is returned by the instruction. and the return went like: minhatabeladobrowse-> (oxbrowse: SetRDD ()), for xbrowse pull data.

I always that way more duplicates the first line, that pesquisasql function is to assemble the sql instruncoes research, which always returns an alias to returns, and these need to go back Pro User xbrowse and choose the data he wants.

more than doubles the first-ever

dbUseArea( .F.,"SQLRDD", "CONSULTA" )
REDEFINE XBROWSE OBRW ALIAS "CONSULTA"

REDEFINE BUTTOM BTN ACTION( PesquisaSql("SELECT * FROM CONSULTA", "CONSULTA"), CONSULTA->( OBRW:SETRDD() ) //

FUNCTION PesquisaSql(cString, cAlias)

LOCAL aTables:={}
LOCAL cSql:="", nErr, nPos, apCode, oSql

oSql    := SR_GetConnection()
cSql    := ALLTRIM(cString)

apCode := SR_SQLParse( cSql, @nErr, @nPos )

nErr := oSql:exec( SR_SQLCodeGen( apCode, oSql:nSystemID ) )

IF nErr != 0
MsgStop("Erro ao executar o script :"+ CRLF + cString + CRLF + "Codigo Retornado : " + STR(nErr) )
RETURN( .F. )
ELSEIF nErr == 0
IF SELECT( (cAlias) ) > 0
(cAlias)->( DBCLOSEAREA() )
ENDIF
dbUseArea( .F.,"SQLRDD",cSql, (cAlias) )

  RETURN( .T. )

ENDIF

RETURN( .T. )

Posts: 36
Joined: Sat Jun 19, 2010 10:09 AM
Re: xBrouse with SQRDD+Firebir
Posted: Fri Jun 10, 2011 10:36 AM

SOLVED!!

Continue the discussion