xBrouse with SQRDD+Firebir

xBrouse with SQRDD+Firebir

Postby gss200610 » Mon Jun 06, 2011 3: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
gss200610
 
Posts: 36
Joined: Sat Jun 19, 2010 10:09 am
Location: Goiania - Goias - Brasil

Re: xBrouse with SQRDD+Firebir

Postby kokookao2007 » Tue Jun 07, 2011 9: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
User avatar
kokookao2007
 
Posts: 59
Joined: Thu May 17, 2007 8:27 am

Re: xBrouse with SQRDD+Firebir

Postby gss200610 » 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.
gss200610
 
Posts: 36
Joined: Sat Jun 19, 2010 10:09 am
Location: Goiania - Goias - Brasil

Re: xBrouse with SQRDD+Firebir

Postby nageswaragunupudi » 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: Select all  Expand view
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
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrouse with SQRDD+Firebir

Postby gss200610 » 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. )
gss200610
 
Posts: 36
Joined: Sat Jun 19, 2010 10:09 am
Location: Goiania - Goias - Brasil

Re: xBrouse with SQRDD+Firebir

Postby gss200610 » Fri Jun 10, 2011 10:36 am

SOLVED!!
gss200610
 
Posts: 36
Joined: Sat Jun 19, 2010 10:09 am
Location: Goiania - Goias - Brasil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 97 guests