xBrowse & SQLRDD

Re: xBrowse & SQLRDD

Postby PeterHarmes » Mon Oct 10, 2011 9:03 am

**UPDATE**

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

Code: Select all  Expand view


   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 :

viewtopic.php?f=3&t=22589

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

Regards,

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

Re: xBrowse & SQLRDD

Postby nageswaragunupudi » Mon Oct 10, 2011 11:25 am

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse & SQLRDD

Postby PeterHarmes » Mon Oct 10, 2011 11:31 am

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
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse & SQLRDD

Postby nageswaragunupudi » Mon Oct 10, 2011 11:54 am

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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse & SQLRDD

Postby PeterHarmes » Mon Oct 10, 2011 1:14 pm


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

Postby PeterHarmes » Tue Oct 11, 2011 2:06 pm

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

Code: Select all  Expand view


METHOD MouseLeave( nRow, nCol, nFlags ) CLASS TXBrowse

   ::lPressed = .f.

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

return nil

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

Re: xBrowse & SQLRDD

Postby Blessed » Tue Oct 25, 2011 5:43 pm

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
Oscar A. Martinez
http://www.multisofthn.com
Honduras, Centro America
xHarbour Enterprise 1.2.2, Fivewin 13.06
User avatar
Blessed
 
Posts: 243
Joined: Wed Sep 19, 2007 4:32 pm
Location: Honduras, C.A.

Re: xBrowse & SQLRDD

Postby PeterHarmes » Mon Oct 31, 2011 9:35 am

Hi Oscar,

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

Regards,

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

Re: xBrowse & SQLRDD

Postby lucasdebeltran » Sat Jun 23, 2012 11:55 am

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.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: xBrowse & SQLRDD

Postby PeterHarmes » Fri Jun 29, 2012 8:10 am

No, I'm currently using the September 2011 version of FWH.
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse & SQLRDD

Postby lucasdebeltran » Fri Jun 29, 2012 9:17 am

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.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: xBrowse & SQLRDD

Postby PeterHarmes » Fri Jun 29, 2012 9:31 am

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.
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse & SQLRDD

Postby lucasdebeltran » Fri Jun 29, 2012 10:23 am

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.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: xBrowse & SQLRDD

Postby PeterHarmes » Fri Jun 29, 2012 10:30 am

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?
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse & SQLRDD

Postby lucasdebeltran » Fri Jun 29, 2012 10:46 am

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.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 47 guests