ATL OLE DB Consumer Code problem

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I'm using ATL OLE DB Consumer code, specifically a CCommand<TAccessor,
TRowset,TMulitple> based class. The accessor is of type CAccessor, the rowset
is of type CRowset and there is a single rowset returned by the query. The
query used is either a simple SQL SELECT Statement or a stored procedure call.

The same behavior is observed with either SQL Server OLE DB Provider or SQL
Native Client provider.

Sometimes, after creating the command on the session and excuting it
(CCommand::Open(...)), the return value is E_FAIL and there is no error
associated.

After digging in the code, it appears that ICommand::Execute returns S_OK
but there is no rowset interface returned (GetInterface() == NULL). MSDN
documentation is not talking about this behavior. You could see the code in
the function CCommand<>::ExecuteAndBind(...) in atldbcli.h. Bind() is called
and returns E_FAIL.

Any help appreciated.
.



Relevant Pages

  • Re: ATL OLE DB Consumer Code problem
    ... The accessor is of type CAccessor, ... is of type CRowset and there is a single rowset returned by the query. ... query used is either a simple SQL SELECT Statement or a stored procedure call. ... The same behavior is observed with either SQL Server OLE DB Provider or SQL ...
    (microsoft.public.data.oledb)
  • Re: ATL OLE DB Consumer Code problem
    ... The accessor is of type CAccessor, ... is of type CRowset and there is a single rowset returned by the query. ... The same behavior is observed with either SQL Server OLE DB Provider or SQL ...
    (microsoft.public.data.oledb)
  • Re: File Names In Table
    ... So if I have your situation correct you need to pick up a rowset from a SQL ... Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. ... There is no reference to the task that has the sql> string in it. ...
    (microsoft.public.sqlserver.dts)
  • Re: DTS - Global Rowset - Use in Execute SQL Task
    ... if it is then you could use a linked server. ... How to loop through a global variable Rowset ... Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. ... > Now I create a "Transform Data Task" to move the data based on the global> Variable. ...
    (microsoft.public.sqlserver.dts)
  • Re: DB_E_BADACCESSORHANDLE when call IRowset->GetData
    ... Are you using SQL CE? ... |> You need to execute the query to get back the rowset. ... |> &hAccessor, NULL); ... |> | Organization: Synnex ...
    (microsoft.public.sqlserver.ce)