|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Max Surace (maxsurace
ALTAVISTA.COM)Date: Wed Jan 02 2002 - 21:50:35 CST
Hi
I am using OLE DB consumer templates to execute a stored procedure. I user RaiseError() within stored proc to propagate error back to the DB layer. In DB layer, I can see that GetErrorInfo() and the rest of the error-related interface works. But at the client layer, GetErrorInfo() return FALSE, which means that logical thread has no error left. I am not using GetErrorInfo() at the DB layer, and not any other COM call, which can invalidate the set COM error at the logical thread. But for some weird reason that COM error is getting reset before the client has a chance to see that.
As per specs, I am immediately returning back from DB layer after the error is detected, and at the client I am immediately calling GetErrorInfo(), but no COM error ccan be detected at COM client level.
The DB component is "Both", and the client is in multithreaded Apt. The consumer class is like
class CInsertResultVariable : public CCommand<CAccessor<CInsertResultVariableAccessor>, CNoRowset >
The DB layer method is like
CInsertResultVariable cResult;
cResult.m_ScriptID = lScriptID;
strcpy ( cResult.m_varName , _bstr_t (VarName ) ) ;
strcpy ( cResult.m_varValue , _bstr_t (VarValue)) ;
HRESULT hr = cResult.OpenAll ();
if ( hr != S_OK )
return hr;
Client level code is:
//call method
if ( hr != S_OK )
{
CComPtr<IErrorInfo> m_spErrorInfo;
CComPtr<IErrorRecords> m_spErrorRecords;
hr = ::GetErrorInfo(0, &m_spErrorInfo);
//m_spErrorInfo=0 and hr is false
Any idea?
Find the best deals on the web at AltaVista Shopping!
http://www.shopping.altavista.com
----------------------------------------------------------------
Users Guide http://discuss.microsoft.com/archives/mailfaq.asp
contains important info. Save time, search the archives at
http://discuss.microsoft.com/archives/index.html .
To unsubscribe, mailto:DCOM-signoff-request
DISCUSS.MICROSOFT.COM
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]