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.