FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problems with an application using ADO
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Problems with an application using ADO
Posted: Mon Jun 10, 2013 10:41 PM
Lucas,

It was not in previous build, so it is related with MsgBar or changes in TControl/TWindow as a result of a post from Antonio´s at Harbour Developers list.


Do you have, or can you make, a small example program that shows the problem so Antonio can find a solution?

Regards,
James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Problems with an application using ADO
Posted: Tue Jun 11, 2013 12:02 AM

Yes. please. we need an example. thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: Problems with an application using ADO
Posted: Tue Jun 11, 2013 07:52 AM

Antonio,

samples\ribbon.prg

Open and wait 15 minutes. Next, click on Cut/copy.

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.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problems with an application using ADO
Posted: Tue Jun 11, 2013 09:31 AM
lucasdebeltran wrote:Antonio,

samples\ribbon.prg

Open and wait 15 minutes. Next, click on Cut/copy.


I confirm the problem that the application freezes if the prg is built with Harbour. We need to kill the task from Task Manager.

There is no problem if built with xHarbour.
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problems with an application using ADO
Posted: Tue Jun 11, 2013 09:45 AM
Enrico Maria Giordano wrote:Dear friends, have you ever had problem with ADO? My customer says that the application freezes at random point and loose the buttonbar icons. Other applications using DBFs works fine. It says that the problem started a couple of days ago. I can't reproduce it in my XP (he's using W7).

Any ideas?

EMG

Obviously the program was not built with FWH 13.05.
May we know if the app was built with xHarbour or Harbour?

In my experience over years, ADO application could freeze if the connection to the Server is lost due to network failure while a connection is open. Except that I never found any other difference between dbf based and ado based application.

Other issues that were discussed relate to resource leaks and freezing of app built with FWH13.05 and Harbour in the case Mr Lucas pointed out.

Losing of bitmaps can happen when there are resource leaks in any application ( fwh or not ) that were run or running currently on the PC. We have means to check resource leaks in an FW app before release.

The issue relating to Harbour appln built with FWH13.05 exists and we need to find solution. The fact that app built with xHarbour does not freeze should give some clue. But I dont think this has any relation to the problem reported by Mr EMG in his first post.
Regards



G. N. Rao.

Hyderabad, India
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problems with an application using ADO
Posted: Tue Jun 11, 2013 10:12 AM
Nageswararao,

nageswaragunupudi wrote:Obviously the program was not built with FWH 13.05.


The problem is with FWH 13.05.

nageswaragunupudi wrote:May we know if the app was built with xHarbour or Harbour?


xHarbour.

nageswaragunupudi wrote:In my experience over years, ADO application could freeze if the connection to the Server is lost due to network failure while a connection is open. Except that I never found any other difference between dbf based and ado based application.


The problem is not tied to ADO, as I already pointed out.

nageswaragunupudi wrote:The fact that app built with xHarbour does not freeze should give some clue.


As I already said, I'm using xHarbour and the app does freeze.

EMG
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problems with an application using ADO
Posted: Tue Jun 11, 2013 10:15 AM
lucasdebeltran wrote:Antonio,

samples\ribbon.prg

Open and wait 15 minutes. Next, click on Cut/copy.


While we shall be working on this, can you please indicate if you experienced such a freeze in apps without using ribbonbar?
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problems with an application using ADO
Posted: Tue Jun 11, 2013 10:18 AM
Mr EMG
As I already said, I'm using xHarbour and the app does freeze.

The app indicated by Lucas is not freezing when I built with xHarbour.
While I keep trying again, can you suggest any other such program?
Regards



G. N. Rao.

Hyderabad, India
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problems with an application using ADO
Posted: Tue Jun 11, 2013 10:31 AM
I think that the problem might be the following line in tmsgitem.prg:

Code (fw): Select all Collapse
METHOD Refresh() INLINE ::hBack := nil, ::oMsgBar:Refresh()


EMG
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Problems with an application using ADO
Posted: Tue Jun 11, 2013 10:34 AM
Enrico

yes is there, to solve

Code (fw): Select all Collapse
METHOD Refresh() INLINE DeleteObject( ::hBack), ::hBack := nil, ::oMsgBar:Refresh()
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problems with an application using ADO
Posted: Tue Jun 11, 2013 10:40 AM
Daniel,

Daniel Garcia-Gil wrote:Enrico

yes is there, to solve

Code (fw): Select all Collapse
METHOD Refresh() INLINE DeleteObject( ::hBack), ::hBack := nil, ::oMsgBar:Refresh()


Ok, but the other problem is that there is already a Refresh method defined in that class.

EMG
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Problems with an application using ADO
Posted: Tue Jun 11, 2013 10:55 AM
no problem

set all together

Code (fw): Select all Collapse
METHOD Refresh() CLASS TMsgItem

   local cMsg

   if ::bMsg != nil
      cMsg = cValToChar( Eval( ::bMsg ) )
      if cMsg != ::cMsg .or. ::lActive != ::lWasActive
         ::cMsg = cMsg
         if IsWindowVisible( ::oMsgBar:hWnd )
            ::Paint()
         endif   
         ::lWasActive = ::lActive
      endif
   endif

   DeleteObject( ::hBack)
   ::hBack := nil
   ::oMsgBar:Refresh()

return nil


and delete

Code (fw): Select all Collapse
METHOD Refresh() INLINE DeleteObject( ::hBack), ::hBack := nil, ::oMsgBar:Refresh()
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problems with an application using ADO
Posted: Tue Jun 11, 2013 12:30 PM

This fixes the msgbar problem, including a resource leak.

Regards



G. N. Rao.

Hyderabad, India
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problems with an application using ADO
Posted: Tue Jun 11, 2013 03:21 PM
Strangely enough, my answer is vanished. Anyone of the admins have deleted it for any reasons? Anyway, here it is again:

Daniel,

Daniel Garcia-Gil wrote:no problem

set all together

Code (fw): Select all Collapse
METHOD Refresh() CLASS TMsgItem

   local cMsg

   if ::bMsg != nil
      cMsg = cValToChar( Eval( ::bMsg ) )
      if cMsg != ::cMsg .or. ::lActive != ::lWasActive
         ::cMsg = cMsg
         if IsWindowVisible( ::oMsgBar:hWnd )
            ::Paint()
         endif   
         ::lWasActive = ::lActive
      endif
   endif

   DeleteObject( ::hBack)
   ::hBack := nil
   ::oMsgBar:Refresh()

return nil


and delete

Code (fw): Select all Collapse
METHOD Refresh() INLINE DeleteObject( ::hBack), ::hBack := nil, ::oMsgBar:Refresh()


Are you absolutely sure this is the correct fix for the freezing problem? My client is angry... :-)

EMG
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problems with an application using ADO
Posted: Tue Jun 11, 2013 03:21 PM
NageswaraRao,

nageswaragunupudi wrote:This fixes the msgbar problem, including a resource leak.


Thank you.

EMG