Hi to all,
Anyone can put a sample with xBrowse with SQLRDD.
If it's posible, define only two fields of file with many fields.
Thank you.
Pere Cordonet
Hi to all,
Anyone can put a sample with xBrowse with SQLRDD.
If it's posible, define only two fields of file with many fields.
Thank you.
Pere Cordonet
>>
If it's posible, define only two fields of file with many fields.
>>
Yes.
@ .. XBROWSE ......
COLUMNS "field1name", "field2name" ;
<other clauses>
I have not used SQLRDD. But I have gone through the manual quickly. It appears SQLRDD does not support OrdKeyCount() and OrdKeyNo(). I am not sure if I am right. There could be some issues with SQLRDD.
I use xBrowse with SQLRDD and can confirm that it works - there are issues with OrdKeyCount() & OrdKeyNo() as nageswaragunupudi says - the only area i have found to be a problem is the "hot key" seeking in a browse.
Regards,
Pete
Thank you, for your answer.
I'll try substitute these functions !
Pere Cordonet
PeterHarmes wrote:I use xBrowse with SQLRDD and can confirm that it works - there are issues with OrdKeyCount() & OrdKeyNo() as nageswaragunupudi says - the only area i have found to be a problem is the "hot key" seeking in a browse.
Regards,
Pete
Recno() & Dbgoto exist and work in the normal way - i'm not too sure about Lastrec() as i don't use it - i will do some tests tomorrow to see if this works.
Dbseek() also works in the same way (although the softseek parameter seems a bit buggy)
I need some time for implement this source.
When i have a result, i'll comment this.
Thank you.
Pere Cordoent ![]()
Tests on Lastrec
Opened orders table - has 7621 rows
Lastrec() returns 7628 which is the largest value in the column sr_recno (where the record number/row number) is stored.
In the xHarbour Reference - Lastrec() should return the number of records, so I would say this function does not work properly under SQLRDD
Pete
Mr. Peter Harmes,
I understand.
For xbrowse to properly work,
1) oBrw:bKeyCount should be a codeblock which should return the total number of rows.
So what function do you advise for this codeblock?
2) oBrw:bKeyNo := { |n| If( n == nil, < serial number of the row >, < goto the n'th row from top> ) }
For bKeyNo codeblock, what functions do you advise?
Opened orders table - has 7621 rows
Lastrec() returns 7628 which is the largest value in the column sr_recno (where the record number/row number) is stored.
Function SR_OrdkeyCount(xOrder)
Local nItem:= 0, nRecno:= Recno()
Local nOO:= OrdNumber()
OrdSetFocus( xOrder )
DbGotop()
DbEval({|| nItem++ })
OrdSetFocus(nOO)
DbGoto(nRecno)
Return nItemFunction SR_OrdkeyNo(xOrder)
Local nItem:= 0, nRecno:= Recno(),nKey:= 0
Local nOO:= OrdNumber()
OrdSetFocus( xOrder )
DbGotop()
DbEval({|| nItem++,Iif(Recno() == nRecno, nKey:= nItem,nil) },,{|| Empty(nKey) } )
Iif(Empty(nKey),nKey:= nItem,nil)
OrdSetFocus(nOO)
DbGoto(nRecno)
Return nKeyYou can download this sample: http://www.despachoarteaga.com.mx/VisorSQL.zip
// Initially
  aRows := {}
  (cAlias)->( DbGoTop() )
  (cAlias)->( DbEval( {|| AAdd( aRows, RecNo() ) } )
  (cAlias)->( DbGoTop() )
// normal xbrowse code Â
  @ <r>, <c> XBROWSE oBrw COLUMNS .....<other clauses> ..;
    ALIAS cAlias ROWS aRows // Please note the clause ROWS aRows@ <r>, <c> XBROWSE oBrw
oBrw:SetRDD (. f.. f.)
oBrw:bKeyNo    := {|| ( ::cAlias )->( SR_OrdkeyNo() )    }
oBrw:bKeyCount := {|| ( ::cAlias )->( SR_OrdkeyCount() ) Â }I dont build a code block for bKeyno, but for bKeycount (where i use it) - i do a SQL count for the number of records that meet the criteria and apply this to a variable and to bKeycount.
By the looks of things on the data we have used, the standard xBrowse functionality works fine!!