FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour RowSet Large and lReadonly
Posts: 114
Joined: Fri Jul 21, 2006 07:15 PM
RowSet Large and lReadonly
Posted: Fri May 31, 2024 02:35 PM
Dear all,
Is possible rowset and lreadonly works the same time?
Like this:
Code (fw): Select all Collapse
oRs := oCn:RowSet( <table>, nRows,.T. )
Regards.
FWH / xHarbour / BCC / MySql

Visual Studio / Harbour / DotNet Maui / C#
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: RowSet Large and lReadonly
Posted: Fri May 31, 2024 03:09 PM

Yes

Regards



G. N. Rao.

Hyderabad, India
Posts: 114
Joined: Fri Jul 21, 2006 07:15 PM
Re: RowSet Large and lReadonly
Posted: Fri May 31, 2024 06:00 PM
Thank you Mr. Rao.

I tried built other sample:
Code (fw): Select all Collapse
function Test()
    local oRs, cTable,oCn
    local oWnd, oBrw, oFont

   oCn := maria_Connect( "209.250.245.152,fwh,fwhuser,FiveTech@2022" )
   if oCn <> NIL
    ? "Conected"
   endif 
   
   oRs := oCn:RowSet( "select * from custx where state = ? ",{ 'NY' },500,.T. )

   DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-14
   DEFINE WINDOW oWnd
   oWnd:SetFont( oFont )

   @ 0,0 XBROWSE oBrw OF oWnd ;
      DATASOURCE oRs AUTOCOLS ;
      CELL LINES FOOTERS NOBORDER

   WITH OBJECT oBrw
      :bRecSeldata   := { || oBrw:KeyNo }
      :nRecSelWidth  := "999,999"
      :bRecSelFooter := { || oBrw:nLen }
      :CreateFromCode()
   END

   oWnd:oClient := oBrw

   DEFINE TIMER oTimer INTERVAL 1000 ACTION __ReadMore( oBrw ) OF oWnd

   ACTIVATE WINDOW oWnd CENTERED ;
      ON INIT ( oTimer:Activate() )

   RELEASE FONT oFont
   oTimer:DeActivate()
   oTimer:End()
   oCn:Close()
   
return nil


func __ReadMore( oBrw )

   local cMsg

   if ! PeekMessage( @cMsg, oBrw:hWnd, 0x100, 0x109, 0 )
      WITH OBJECT oBrw
         if :oDbf:lMore
            :oDbf:ReadNext( 5555 )
            :GoBottom()
            :Refresh()
         else
            oTimer:DeActivate()
         endif
      END
   endif

return nil
But result error:
Code (fw): Select all Collapse
Código           : 1
Descrição do Erro:
Erro BASE/1070  Erro nos parƒmetros: ==
Código: 1
Detalhamento:
------------
Arg. 1      Tipo: O Valor: FWMARIACONNECTION
Arg. 2      Tipo: L Valor: .T.

Chamada de Pilha
================
Chamado de FWMARIAROWSET:NEW(1580)
Chamado de FWMARIACONNECTION:EXECUTE_SQL(6837)
Chamado de FWMARIACONNECTION:ROWSET(7549)
Chamado de MARIANEWRECORD(202)
Any other ideas?

Regards
FWH / xHarbour / BCC / MySql

Visual Studio / Harbour / DotNet Maui / C#
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: RowSet Large and lReadonly
Posted: Sat Jun 01, 2024 04:01 AM
Code (fw): Select all Collapse
oRs := oCn:RowSet( "select * from custx where state = ? ",{ 'NY' },500,.T. )
This is working in the recent versions but not in 1709

This works in 1709
Code (fw): Select all Collapse
oRs := oCn:RowSet( "select * from custx where state = 'NY' ",500,.T. )
OR
Code (fw): Select all Collapse
oRs := oCn:RowSet( "select * from custx where state = ? LIMIT ? ",{ "NY", 500}, .T. )
Regards



G. N. Rao.

Hyderabad, India
Posts: 114
Joined: Fri Jul 21, 2006 07:15 PM
Re: RowSet Large and lReadonly
Posted: Sat Jun 01, 2024 12:55 PM
Thank you Mr. Rao.

I am using FWH 23.10:
Code (fw): Select all Collapse
Application
===========
   Path and name: D:\Softway\ProjetosWanderson\EsocialSQL\sinwin.EXE (32 bits)
   Size: ********* bytes
   Compiler version: xHarbour 1.3.0 Intl. (SimpLex) (Build 20231104)
   FiveWin  version: FWH 23.10
   C compiler version: Borland/Embarcadero C++ 7.7 (32-bit)
   Windows 11 64 Bits, version: 6.2, Build 9200 

   Time from start: 0 hours 0 mins 18 secs 
   Error occurred at: 01/06/2024, 09:48:42
   Error description: Error BASE/1070  Erro nos parƒmetros: ==
   Args:
     [   1] = O   FWMARIACONNECTION
     [   2] = L   .T.

Stack Calls
===========
   Called from: .\source\internal\FWMARIA.PRG => FWMARIAROWSET:NEW( 1580 )
   Called from: .\source\internal\FWMARIA.PRG => FWMARIACONNECTION:EXECUTE_SQL( 6837 )
   Called from: .\source\internal\FWMARIA.PRG => FWMARIACONNECTION:ROWSET( 7549 )
   Called from: D:\Softway\ProjetosWanderson\EsocialSQL\PRGh\funcao32.prg => MARIANEWRECORD( 202 )
What version must have I to use?

Regards.
FWH / xHarbour / BCC / MySql

Visual Studio / Harbour / DotNet Maui / C#
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: RowSet Large and lReadonly
Posted: Mon Jun 03, 2024 06:00 PM
Here it is working for me with FWH2307 and FWH2310.
This is my sample program.
Code (fw): Select all Collapse
#include "fivewin.ch"

function Main()

   local oCn   := maria_Connect( "208.91.198.197:3306,fwhdemo,gnraofwh,Bharat@1950", .t. )
   local oRs

   MsgRun( "Reading RowSet", "CUSTX", { || ;
   oRs   := oCn:RowSet( "select * from custx where state = ? order by id", { "NY" }, 30, .T. ) } )
   XBROWSER oRs SHOW RECID TITLE FWVERSION
   oRs:Close()

   oCn:Close()

return nil
Save this to samples and build with buildh.bat
Like this:
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: RowSet Large and lReadonly
Posted: Mon Jun 03, 2024 06:00 PM
Here it is working for me with FWH2307 and FWH2310.
This is my sample program.
Code (fw): Select all Collapse
#include "fivewin.ch"

function Main()

   local oCn   := maria_Connect( "208.91.198.197:3306,fwhdemo,gnraofwh,Bharat@1950", .t. )
   local oRs

   MsgRun( "Reading RowSet", "CUSTX", { || ;
   oRs   := oCn:RowSet( "select * from custx where state = ? order by id", { "NY" }, 30, .T. ) } )
   XBROWSER oRs SHOW RECID TITLE FWVERSION
   oRs:Close()

   oCn:Close()

return nil
Save this to samples and build with buildh.bat
Like this:
Regards



G. N. Rao.

Hyderabad, India
Posts: 114
Joined: Fri Jul 21, 2006 07:15 PM
Re: RowSet Large and lReadonly
Posted: Mon Jun 03, 2024 08:39 PM
Thank you for your attention Mr Rao,

I just tested with harbour and really works fine.

But using xHarbour results an error:
http://flynfe.com.br/download/Sample.mp4
But ok, I will tray other way to handle my large databases.

Regards.
FWH / xHarbour / BCC / MySql

Visual Studio / Harbour / DotNet Maui / C#
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: RowSet Large and lReadonly
Posted: Tue Jun 04, 2024 08:28 AM
But using xHarbour results an error:
Please write to me to this email address:
nageswaragunupudi [at] gmail [dot] com

We will send you revised libraries for both harbour and xharbour.
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: RowSet Large and lReadonly
Posted: Tue Jun 04, 2024 08:34 AM
But ok, I will tray other way to handle my large databases.
For large tables, do NOT use RowSet.
There is another class RecSet specially made to handle very large tables.

Let us try to open "custbig" table which has more than 4 million records.
Code (fw): Select all Collapse
#include "fivewin.ch"

function Main()

   local oCn   := maria_Connect( "208.91.198.197:3306,fwhdemo,gnraofwh,Bharat@1950", .t. )
   local oRs

   ? "reading custbig"
   oRs   := oCn:RecSet( "custbig", -100 )
   XBROWSER oRs SHOW RECID TITLE FWVERSION
   oRs:Close()
   oCn:Close()

return nil
Regards



G. N. Rao.

Hyderabad, India
Posts: 114
Joined: Fri Jul 21, 2006 07:15 PM
Re: RowSet Large and lReadonly
Posted: Tue Jun 04, 2024 02:06 PM

Mr Rao, everything ok now, with these 3 classes I can solve everything I need.

Thank you for your attention.

Regards.

FWH / xHarbour / BCC / MySql

Visual Studio / Harbour / DotNet Maui / C#

Continue the discussion