FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FWH: MySql/MariaDB: RowSet object
Posts: 43
Joined: Fri Jun 01, 2007 12:41 PM
Re: FWH: MySql/MariaDB: RowSet object
Posted: Thu May 18, 2017 01:23 PM
CHANGE LINE 35 TO
Code (fw): Select all Collapse
   oRs:bOnChangePage = { || vsay := alltrim(STR(oRs:nCurrentPage))+" / "+alltrim( STR(oRs:nMaxPages)),;
                            oSay:refresh(),oBrw:Refresh() }
Posts: 43
Joined: Fri Jun 01, 2007 12:41 PM
Re: FWH: MySql/MariaDB: RowSet object
Posted: Mon May 22, 2017 06:47 PM
MR Rao...

OLD - Don´t work key down or key UP
Code (fw): Select all Collapse
oRs:lAutoPage     := .t.


NEW - BUT don´t work oRs:bOnChangePage with key down or key UP
Code (fw): Select all Collapse
oRs:lAutoExpand   := .t.


https://www.youtube.com/watch?v=DgP54iw ... e=youtu.be
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: FWH: MySql/MariaDB: RowSet object
Posted: Tue May 23, 2017 12:28 AM

In your dolphin example also pressing down arrow key does not go to next page. I sent you a sample which works exactly like your sample.
Note: Personally I do not like this kind of paging.

I prefer this

viewtopic.php?f=3t=33830p=199916hilit=million#p199916

&&&

Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: FWH: MySql/MariaDB: RowSet object
Posted: Mon Jul 09, 2018 05:51 AM
Dynamically changing fields, [table], [connection] of a Rowset at runtime and also change the XBrowse:

This is possible from FWH 18.05:
Code (fw): Select all Collapse
oRs := oCn:RowSet( cSql )
// set up browse 
// during runtime
//

oRs:oCn := oNewCn // Optional
oRs:ReQuery( cNewSql ) // same or different table
oRs:SetXbrColumns( oBrw )


Sample:
Code (fw): Select all Collapse
#include "fivewin.ch"

function Main()

   local oCn, oRs, oDlg, oBrw
   local aSql  := {  "select id,first,city, salary from customer", ;
                     "select * from states", ;
                     "select * from annual" }

   oCn   := FW_DemoDB()
   oRs   := oCn:RowSet( aSql[ 1 ] )

   DEFINE DIALOG oDlg SIZE 600,400 PIXEL TRUEPIXEL ;
      TITLE "SWITCH TABLES/FIELDS AT RUNTIME"

   @ 60, 20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE oRs AUTOCOLS CELL LINES NOBORDER
   oBrw:CreateFromCode()

   @ 20, 20 BTNBMP PROMPT "CUSTOMER" ;
      SIZE 100,35 PIXEL OF oDlg FLAT ;
      ACTION ( CursorWait(), oRs:Requery( aSql[ 1 ] ), oRs:SetXbrColumns( oBrw ) )

   @ 20,140 BTNBMP PROMPT "STATES" ;
      SIZE 100,35 PIXEL OF oDlg FLAT ;
      ACTION ( CursorWait(), oRs:Requery( aSql[ 2 ] ), oRs:SetXbrColumns( oBrw ) )

   @ 20,260 BTNBMP PROMPT "ANNUAL" ;
      SIZE 100,35 PIXEL OF oDlg FLAT ;
      ACTION ( CursorWait(), oRs:Requery( aSql[ 3 ] ), oRs:SetXbrColumns( oBrw ) )

   ACTIVATE DIALOG oDlg CENTERED

   oCn:Close()

return nil


Regards



G. N. Rao.

Hyderabad, India
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
Re: FWH: MySql/MariaDB: RowSet object
Posted: Sun Dec 12, 2021 10:05 PM
TEngo esta consulta:
Code (fw): Select all Collapse
#define QUINCENA ;
"select " + ;
"a.id          as c1, " + ;
"b.nombre      as c2, " +;
"a.fecha       as c3, " + ;
"c.id          as c4_0, " +;
"c.item        as c4, " +;
"a.pago        as c5, " + ;
"a.pobreza     as c6, " + ;
"a.gratis      as c7 " + ;
"from tbdiario a " + ;
"left join tbente as b on b.id = a.idente " +;
"left join tbitems as c on c.id = a.iditem "+;
"WHERE a.fecha >= ? AND a.fecha <= ? "+ ;
"ORDER BY a.iditem, a.fecha "


y hago lo siguiente:
::oQry := ::QUERY( QUINCENA, { ::dInicio, ::dFinal } )
::setfilter( "c4_0>0 and c4_0<11" )


pero necesito que este ordenado por los campos "c2" y "c3" pero no logro hacerlo, solo me ordena por "c3"
Code (fw): Select all Collapse
   ::oQry:setorder( "c2", "c3" )
   ::oQry:Requery()
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: FWH: MySql/MariaDB: RowSet object
Posted: Mon Dec 13, 2021 10:49 AM

Please try:

::oQry:setorder( "c2,c3" )

::oQry:Requery() Is not necessary here.

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
Re: FWH: MySql/MariaDB: RowSet object
Posted: Wed Dec 15, 2021 01:29 AM
AL hacer esto:
Code (fw): Select all Collapse
         ::oQry:setFilter( "c2_0<2" )
         ::oQry:setorder("c2_0, c3, c4_0")


y luego hacer
Code (fw): Select all Collapse
xbrowser ::oQry


solo me ordena por el campo c2_0 el resto no le da importancia
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
Posts: 97
Joined: Mon Nov 21, 2005 10:29 AM
Re: FWH: MySql/MariaDB: RowSet object
Posted: Tue Oct 01, 2024 05:31 PM

Hello,

 have somebody tryed to rewrite tdatabase() class to use RowSet object instead of dbf file?

For sample

METHOD FCount() INLINE ( ::oRc:FCount() ) //where ::oRc is rowset object created for this object

instead of

METHOD FCount() INLINE ( ::nArea )->( FCount() )

Could this approach work?

And am I correct it is not possible to inherit from Mariadb connection RowSet class?

Our database classes inherit from tdatabase() and would be easy first step to replace tdatabase() functionality without changing higher level code...

Taavi.

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: FWH: MySql/MariaDB: RowSet object
Posted: Tue Oct 01, 2024 05:40 PM
Code (fw): Select all Collapse
oRowSet:FCount()
is available and works exactly like TDatabase FCount()

We tried to make RowSet methods compatible with TDataBase and ADO RecordSet.

Please let us know if you want more, we will provide you natively with RowSet object.
Regards



G. N. Rao.

Hyderabad, India
Posts: 97
Joined: Mon Nov 21, 2005 10:29 AM
Re: FWH: MySql/MariaDB: RowSet object
Posted: Wed Oct 02, 2024 05:51 PM

Hello,

so rewriting tdatabase() class to use to use rowset should work?

Maybe someone have done it already? Seems like logical path for me from dbf to Mariadb for those using tdatabase()...

Rowset object would be helpful, I need an class which has all methods of tdatabase() to replace database object in our classes. This way I could bypass creating my own class for that.

Taavi.

Posts: 97
Joined: Mon Nov 21, 2005 10:29 AM
Re: FWH: MySql/MariaDB: RowSet object
Posted: Mon Oct 14, 2024 11:15 AM

Hello,

can I have Rowset object, please?

Taavi

Continue the discussion