xBrowse & SQLRDD

PeterHarmes
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse & SQLRDD

Post by PeterHarmes »

**UPDATE**

This is to fix the shift & left-click to select multiple records under SQLRDD

Code: Select all


   case nOperation == 3 // Shift & lclick
      cEndIndexKey := &( ( ::cAlias )->(IndexKey()) )
      uBook   := Eval( ::bBookMark )
      if ( ::cAlias )->( RddName() ) == "SQLRDD"
        uCurRow := ( ::cAlias )->(RecNo())
      else 
        uCurRow := ::KeyNo()
      endif
      Eval( ::bBookMark,  Atail( ::aSelected ) )
      if ( ::cAlias )->( RddName() ) == "SQLRDD"
        uOldRow := ( ::cAlias )->(RecNo())
      else       
        uOldRow := ::KeyNo()
      endif
      cStIndexKey := &( ( ::cAlias )->(IndexKey()) )
      if uOldRow != uCurRow
         ::aSelected := { Atail( ::aSelected ) }
         if IF( ( ::cAlias )->( RddName() ) == "SQLRDD", cEndIndexKey > cStIndexKey, uCurRow > uOldRow)
            CursorWait()
            do while ( uTemp := Eval( ::bBookMark ) ) != uBook .and. ! ::Eof()
               If Ascan( ::aSelected, uTemp ) == 0
                  Aadd( ::aSelected, uTemp )
               Endif
               ::Skip( 1 )          // Eval( ::bSkip, 1 )
            enddo
            CursorArrow()
         else
            CursorWait()
            do while ( uTemp := Eval( ::bBookMark ) ) != uBook .and. ! ::Bof()
               If Ascan( ::aSelected, uTemp ) == 0
                  Aadd( ::aSelected, uTemp )
               endif
               ::Skip( -1 )         // Eval( ::bSkip, -1 )
            enddo
            CursorArrow()
         endif
         Aadd( ::aSelected, uBook )
         Eval( ::bBookMark, uBook )
         // ::lRefreshOnlyData := .t.
         ::GetDC()
         ::Paint()
         ::ReleaseDC()

      else
         Eval( ::bBookMark, uBook )
      endif

 
Will this code be considered for future versions of FW or will I need to make these changes each time?

I have bound the code with SQLRDD conditions, so hopefully it wont effect 95% of other users. If this code is to be considered, can someone review my other post I made last week :

http://forums.fivetechsupport.com/viewt ... =3&t=22589

If someone would like me to email my complete xbrowse.prg, then let me know.

Regards,

Pete
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse & SQLRDD

Post by nageswaragunupudi »

Please continue with your fixes and we shall consider all of them later.
Regards

G. N. Rao.
Hyderabad, India
PeterHarmes
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse & SQLRDD

Post by PeterHarmes »

I will release my software to a few of our SQL customers and see if we get any problems. If all ok, I can email you my xBrowse.prg

Regards,

Pete
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse & SQLRDD

Post by nageswaragunupudi »

Please note that (::cAlias)->( RecNo() ) is exaactly the same as Eval( ::bBookMark ) or ::BookMark.
Instead of saying uCurRow := ( ::cAlias )->( RecNo() ), we rather code as uCurRow := ::BookMark or uCurRow := Eval( ::bBookMark ), which is already done.
In other words uBook is exactly your uCurRow.

What does IndexKey() return?
In other RDDs it is same as OrdKey() and returns the index expression of the current order. How does that help you here?
Please let me know.

Please also keep in mind that except in the Set??? methods, column Adjust methods and Sort methods, the xbrowse code is totally independent of the data source. The code is the same whether the datasource is RDD, array, recset or any other. We need to stick to this convention while making any modifications in the xbrowse.
Regards

G. N. Rao.
Hyderabad, India
PeterHarmes
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse & SQLRDD

Post by PeterHarmes »


Please note that (::cAlias)->( RecNo() ) is exaactly the same as Eval( ::bBookMark ) or ::BookMark.
Instead of saying uCurRow := ( ::cAlias )->( RecNo() ), we rather code as uCurRow := ::BookMark or uCurRow := Eval( ::bBookMark ), which is already done.
In other words uBook is exactly your uCurRow.
When I used Bookmark as the recno, I had some corruptions in the browse when browsing a scoped table (the first record would appear at the bottom of the list) Taking the SQLRDD section out of the SETRDD method fixes these problems.

What does IndexKey() return?
In other RDDs it is same as OrdKey() and returns the index expression of the current order. How does that help you here?
Please let me know.
I've used Indexkey to know if the previous record (where you first clicked and held the shift key) is higher or lower in the list to the second click. This then tells the system to either Dbskip() or Dbskip(-1) to the last record (this is also why I use Recno() instead of bookmark as OrdKey() doesnt work in SQLRDD) - As I said earlier, the only problem would be if you dont use a record with unique keys in the current index but this could be a condition of using this method.

If you need to see an xbrowse working on SQLRDD, I can show you if you want to log onto my machine.

Best Regards,

Pete
PeterHarmes
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse & SQLRDD

Post by PeterHarmes »

Just testing xBrowse again and my change to the method MouseLeave blows up, think it should be:

Code: Select all


METHOD MouseLeave( nRow, nCol, nFlags ) CLASS TXBrowse

   ::lPressed = .f.

   if Empty( ::cAlias) .OR. ( ::cAlias )->( RddName() ) <> "SQLRDD"
       ::Refresh()
   endif

return nil

 
User avatar
Blessed
Posts: 243
Joined: Wed Sep 19, 2007 4:32 pm
Location: Honduras, C.A.
Contact:

Re: xBrowse & SQLRDD

Post by Blessed »

Hi Peter
I implemented the changes you suggested in xBrowse and stabilized much.
What version of FWH are using?, I was wanting to upgrade, but I think I will end my applications with version 10.10
Since that time vere after the jump.

Regards
_ A. Martinez
http://www.multisofthn.com
Honduras, Centro America
xHarbour Enterprise 1.2.2, Fivewin 13.06
PeterHarmes
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse & SQLRDD

Post by PeterHarmes »

Hi _,

I'm using FWH version 11.09 which I think is the most compatible version for a while with SQLRDD & xHarbour Commercial

Regards,

Pete
User avatar
lucasdebeltran
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am
Contact:

Re: xBrowse & SQLRDD

Post by lucasdebeltran »

Hi Peter,

Are you using SQLRDD with laetst FWH version?.

Thanks.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
PeterHarmes
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse & SQLRDD

Post by PeterHarmes »

No, I'm currently using the September 2011 version of FWH.
User avatar
lucasdebeltran
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am
Contact:

Re: xBrowse & SQLRDD

Post by lucasdebeltran »

And which version of SQLRDD are you using?.

Thanks.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
PeterHarmes
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse & SQLRDD

Post by PeterHarmes »

I'm using it with xHarbour commercial 6th June 2010 - I tried a later version but had reports from my customers that there was a performance drop.
User avatar
lucasdebeltran
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am
Contact:

Re: xBrowse & SQLRDD

Post by lucasdebeltran »

Thanks.

Does it have a revision number or build, like Fivetech?.

Latest version does not work fine with Browses.

Did you ever get support from xHarbour.com?.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
PeterHarmes
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse & SQLRDD

Post by PeterHarmes »

SQLRDD reports SQLRDD(EX) 9.0, Build 0015, MGMNT 1.72

I did report the slowness to xHarbour, but they didnt offer much help

The problems with the browses I posted here as I use xBrowse.

What problems are you getting with the browses?
User avatar
lucasdebeltran
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am
Contact:

Re: xBrowse & SQLRDD

Post by lucasdebeltran »

With your build, Browses work fine.

With latest build, scroll does not work propelly and when you edit a record, the browse goes crazy and duplicates the view.

I did not get a reply from Patrick, so that scares me from purchasing their product.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
Post Reply