ADO RecordSet Fetch() ?

Re: ADO RecordSet Fetch() ?

Postby avista » Wed Jul 31, 2013 2: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,
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: ADO RecordSet Fetch() ?

Postby nageswaragunupudi » Wed Jul 31, 2013 3: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
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: ADO RecordSet Fetch() ?

Postby avista » Thu Aug 01, 2013 8: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,
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: ADO RecordSet Fetch() ?

Postby nageswaragunupudi » Thu Aug 01, 2013 9: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: Select all  Expand view
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
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: ADO RecordSet Fetch() ?

Postby avista » 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
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: ADO RecordSet Fetch() ?

Postby elvira » Sat Aug 03, 2013 3:41 pm

Hello,

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

Many thanks.
elvira
 
Posts: 515
Joined: Fri Jun 29, 2012 12:49 pm

Re: ADO RecordSet Fetch() ?

Postby avista » Sat Aug 03, 2013 10:30 pm

Thanks
Already sent
Regards,
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], richard-service and 81 guests