FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ADO RecordSet Fetch() ?
Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
Re: ADO RecordSet Fetch() ?
Posted: Wed Jul 31, 2013 02:23 PM

Rao,

Thanks so myuch, you are right

I have one more quewstion (problem) with ERROR object of oRs:Open()
oErr:Description always return DISP_E_UNKNOWNNAME
and oErr:Number, oErr:Source, oErr:NativeError... dont exist.

oErr:modulename return nothing empty string
oErr:osthreadid return 0
oErr:procline return 0
oErr:procname return TOLEAUTO:OPEN
oErr:runningthreads return 0
oErr:vmthreadid return 0

Please some sugestion how to detect the error returned from server.
I use Informix database

Best Regards,

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: ADO RecordSet Fetch() ?
Posted: Wed Jul 31, 2013 03:41 PM

Harbour shows the Ado Error correctly. xHarbour does not.
I suggest you use FWH function FW_ShowAdoError( oCn ), where oCn is the connection object.

TRY
oRs:Open( .... )
CATCH
FW_ShowAdoError( oCn )
<< decide what to do >>
END

Regards



G. N. Rao.

Hyderabad, India
Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
Re: ADO RecordSet Fetch() ?
Posted: Thu Aug 01, 2013 08:53 PM
Rao,

In which version of fwh is addes function FW_ShowAdoError()
I still use 13.03

Harbour shows the Ado Error correctly. xHarbour does not.


This mean that if i move to harbour from xharbour will work ok ?
If yes can i use FWH + bcc582 or i must use something else MSVC or ?
What kindd of changes i must to do if i move to harbour in my source ?

What is better choice xharbour or harbour ?

Global WHAT is the diference between harbour and xharbour ?

Best best regards,
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: ADO RecordSet Fetch() ?
Posted: Thu Aug 01, 2013 09:23 PM
The function FW_ShowAdoError() was first included in FWH 13.05.

The logic is well known to all users and it should be fine for me to share the code here. You may even find the main part of this code already posted in these forums
Code (fw): Select all Collapse
function FW_ShowAdoError( oCn, lSilent )

   local nErr, oErr, cErr

   DEFAULT lSilent := .f.

   if ( nErr := oCn:Errors:Count ) > 0
      oErr  := oCn:Errors( nErr - 1 )
      if ! lSilent
         WITH OBJECT oErr
            cErr     := oErr:Description
            cErr     += CRLF + 'Source       : ' + oErr:Source
            cErr     += CRLF + 'NativeError  : ' + cValToChar( oErr:NativeError )
            cErr     += CRLF + 'Error Source : ' + oErr:Source
            cErr     += CRLF + 'Sql State    : ' + oErr:SQLState
            cErr     += CRLF + Replicate( '-', 50 )
            cErr     += CRLF + ProcName( 1 ) + "( " + cValToChar( ProcLine( 1 ) ) + " )"

            MsgAlert( cErr, IfNil( oCn:Provider, "ADO ERROR" ) )
         END
      endif
   else
      MsgAlert( "ADO ERROR UNKNOWN" )
   endif

return oErr

You may include this function in your libraries. You may even modify as you like.

For this purpose alone you need consider changing (x)Harbour.
Which is better is better explained by friends who are more knowledgeable than me.

I work with both xHarbour and Harbour for testing my contributions to FWH library.

Personally I still continue to use bcc582. For my personal software work using ADO, I still continue xHarbour. There is some functionality available in xHarbour but not in Harbour and I need that for some advanced usage of ADO. I am waiting for Harbour to provide similar functionality.
Regards



G. N. Rao.

Hyderabad, India
Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
Re: ADO RecordSet Fetch() ?
Posted: Sat Aug 03, 2013 12:33 PM

Rao, Rick, ...

Many thanks for reply and help

Many thanks to Adolfo for great manual which he send to me for ADO 2.8
i think someone need to put this manual on place where everyone can download it

Best regards to all

Posts: 518
Joined: Fri Jun 29, 2012 12:49 PM
Re: ADO RecordSet Fetch() ?
Posted: Sat Aug 03, 2013 03:41 PM

Hello,

You can sent it to alinares@fivetechsoft.com so he could upload to contributions.

Many thanks.

Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
Re: ADO RecordSet Fetch() ?
Posted: Sat Aug 03, 2013 10:30 PM

Thanks
Already sent
Regards,

Continue the discussion