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.