Errors Occurred (80040e21) and DBSTATUS_E_UNAVAILABLE at SetData()



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

.



Relevant Pages

  • Re: VB connection to SQL server
    ... > the client machine begins to lose its relevance and accuracy as soon as it ... > aware that the data is probably out of date, a client sided cursor might ... > design minimises the possibility that records will have changed in the ... >> The Database server is in the office, and people use the Vb program from ...
    (microsoft.public.vb.database)
  • Re: Huge memory comsumption of ADODB Connection object
    ... unless the cursor is returning data to the client* I don't see ... I suppose this could cause some extra memory ... Is there a similar behavior in Sybase? ... Server was originally based on that rdbms, so there very well may be. ...
    (microsoft.public.data.ado)
  • Re: VB connection to SQL server
    ... "Chris Barber" wrote in message ... > recordsets (client side cursor) to allow you to persist the recordsets to ... aware that the data is probably out of date, a client sided cursor might fit ... That is because the SELECT statement is executed on the server and the data ...
    (microsoft.public.vb.database)
  • Re: ADO server side cursor sloooow
    ... Using the ODBC driver my tests show that both client and server side ... forward only server side cursor is faster than a client side cursor as ... requiring over 1000 trips over the network. ...
    (comp.databases.btrieve)
  • Re: Accessing A Large MS SQL Table Over ADO Components
    ... Client-side cursor fetches all rows, ... Because I had some performance loss when I set it up to Server ... Server-side cursor does not fetch all rows to client, so if server is on the ... > If we want to display the data on a readonly grid wich component is the ...
    (borland.public.delphi.database.ado)

Loading