Errors Occurred (80040e21) and DBSTATUS_E_UNAVAILABLE at SetData()
- From: "Egbert Nierop \(MVP for IIS\)" <egbert_nierop@xxxxxxxxxxxxxx>
- Date: Fri, 28 Apr 2006 00:46:26 +0200
Hello,
I have a class, based on ATL oledb providers. And it allows both to run as a server or a client cursor. In the past, it was working with server cursors, but not anymore :<
The following sequence happens.
1) open a separate database connection (for the server side cursor)
2) Open the data class (see below)
3) modify a few columns, and set a few of them to DBSTATUS_S_IGNORE
4) SetData(0) ;
The error occurs at 4.
If I run the code, separately, in a console app, I got the same error, but after adding the primary key column in the stored proc, that worked. But my COM component, -still- has trouble with the same error (the fix does not work here).
QUESTION: Do I miss some property to enable this serverside update?
HRESULT OpenRowset(const CSession& session) throw()
{
CDBPropSet propset(DBPROPSET_ROWSET);
propset.AddProperty(DBPROP_ISequentialStream, true);
// optimizes the sp_cursor statement so it does not include extra where clause checks only to avoid overwrites to 'previous' updates
propset.AddProperty(DBPROP_COMMANDTIMEOUT, (LONG)30);
if (isServerCursor)
{
propset.AddProperty(DBPROP_IRowsetChange, true);
propset.AddProperty(DBPROP_OTHERUPDATEDELETE, true);
propset.AddProperty(DBPROP_OWNUPDATEDELETE, true);
propset.AddProperty(DBPROP_UPDATABILITY, (LONG) DBPROPVAL_UP_CHANGE);
propset.AddProperty(DBPROP_SERVERCURSOR, true);
propset.AddProperty(DBPROP_LOCKMODE, (LONG)DBPROPVAL_LM_SINGLEROW);
}
HRESULT hr = Open(session, L"{CALL dbo.pApplicationFetch(?)}", &propset);
#ifdef _DEBUG
if(FAILED(hr))
AtlTraceErrorRecords(hr);
#endif
return hr;
}
};
CREATE PROCEDURE pApplicationFetch
(
@App_Key varbinary(16)
)
AS
SELECT
mytable.STATE,
mytable2.State AS StateBlob,
TEXTPTR(mytable2.State) AS PtrState,
mytable.zLen, mytable.APP_KEY
FROM mytable
LEFT OUTER JOIN mytable2 (NOLOCK)
ON mytable.APP_KEY = mytable2.APP_KEY
WHERE mytable.APP_KEY = @App_Key
GO
.
- Prev by Date: vfpoledb and ICommandPersist
- Next by Date: Multiple oracle homes
- Previous by thread: vfpoledb and ICommandPersist
- Next by thread: Multiple oracle homes
- Index(es):
Relevant Pages
|
Loading