Page 1 of 1
RowSet Large and lReadonly
Posted: Fri May 31, 2024 2:35 pm
by Eroni
Dear all,
Is possible rowset and lreadonly works the same time?
Like this:
Regards.
Re: RowSet Large and lReadonly
Posted: Fri May 31, 2024 3:09 pm
by nageswaragunupudi
Yes
Re: RowSet Large and lReadonly
Posted: Fri May 31, 2024 6:00 pm
by Eroni
Thank you Mr. Rao.
I tried built other sample:
Code: Select all | Expand
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: Select all | Expand
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
Re: RowSet Large and lReadonly
Posted: Sat Jun 01, 2024 4:01 am
by nageswaragunupudi
Code: Select all | Expand
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: Select all | Expand
oRs := oCn:RowSet( "select * from custx where state = 'NY' ",500,.T. )
OR
Code: Select all | Expand
oRs := oCn:RowSet( "select * from custx where state = ? LIMIT ? ",{ "NY", 500}, .T. )
Re: RowSet Large and lReadonly
Posted: Sat Jun 01, 2024 12:55 pm
by Eroni
Thank you Mr. Rao.
I am using FWH 23.10:
Code: Select all | Expand
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.
Re: RowSet Large and lReadonly
Posted: Mon Jun 03, 2024 6:00 pm
by nageswaragunupudi
Here it is working for me with FWH2307 and FWH2310.
This is my sample program.
Code: Select all | Expand
#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:
Re: RowSet Large and lReadonly
Posted: Mon Jun 03, 2024 6:00 pm
by nageswaragunupudi
Here it is working for me with FWH2307 and FWH2310.
This is my sample program.
Code: Select all | Expand
#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:
Re: RowSet Large and lReadonly
Posted: Mon Jun 03, 2024 8:39 pm
by Eroni
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.
Re: RowSet Large and lReadonly
Posted: Tue Jun 04, 2024 8:28 am
by nageswaragunupudi
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.
Re: RowSet Large and lReadonly
Posted: Tue Jun 04, 2024 8:34 am
by nageswaragunupudi
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: Select all | Expand
#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
Re: RowSet Large and lReadonly
Posted: Tue Jun 04, 2024 2:06 pm
by Eroni
Mr Rao, everything ok now, with these 3 classes I can solve everything I need.
Thank you for your attention.
Regards.