XBrowse + MySQL

XBrowse + MySQL

Postby ADutheil » Wed Feb 02, 2011 6:57 pm

I am trying to rewrite a working app that use common listbox with xbrowse.

oServ := TMySQLServer():New( "10.73.0.16", "andre", "senhateste" )
oQuer := oServ:query( "SELECT id, nome, ativ FROM atividades" )

DEFINE WINDOW oWnd
oLbx := TXBrowse():new( oWndc )
oLbx:SetMysql( oQuer )
oLbx:createfromcode()
oWndc:oClient := oLbx
ACTIVATE WINDOW oWndc

Error description: Error BASE/44 Assigned value is wrong class: TXBROWSE:NLEN
Args:
[ 1] = C
Stack Calls
===========
Called from: => TXBROWSE:_NLEN(0)
Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE(386)

I saw that xbrowse use ::oMysql:RecCount() in the SetMysql method. But oQuer:RecCount() returns an empty string while oQuer:lastrec() returns the correct number of rows. I modified xbrowse to use lastrec() and the xbrowse displays OK but other erros pop up. Só I like to know if I am using xbrowse+mysql in a wrong way.
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: XBrowse + MySQL

Postby Antonio Linares » Mon Feb 07, 2011 11:28 am

André,
I modified xbrowse to use lastrec() and the xbrowse displays OK but other erros pop up

What errors are them ? thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41366
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: XBrowse + MySQL

Postby ADutheil » Mon Feb 07, 2011 12:41 pm

- oQuer:lastRec() returns 9 but xbrowse shows 13 lines, 4 of them empty
Image

- pressing down key does not change the index row of xbrowse. The data of next line is shown at the same position.
Image

- after a few seconds the browse refreshes by itself.
Image
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: XBrowse + MySQL

Postby Antonio Linares » Sat Feb 12, 2011 1:03 am

André,

What TMySQL.prg version are you using ?

Please post here its source code, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41366
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 67 guests