Re: Error adding command properties for stored procedure call
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Sat, 29 Aug 2009 12:36:55 +0000 (UTC)
andrew_k (andrew_k@xxxxxxxxxxxxxxxxxxxxxxxxx) writes:
I'm updating an OleDb application. I didn't write the original logic
however it closely resembles the OleDb samples provided by Microsoft. It
uses the standard IDBInitialize, IDBCreateSession, IDBCreateCommand and
ICommandText interfaces to call a stored procedure, returning an IRowset
instance. The ICommandWithParams interface is used to set parameter
information for the stored procedures and IID_IAccessor to create
bindings for the buffer to hold the returned data. ie. fairly standard
OleDb code, as noted virtually identical to the samples provided by
Microsoft. It works well and has done for a while. Currently the Rowsets
are all forward only. All the update requires is that the Rowsets
support being able to scroll through the data more than once. According
to the documentation this is done by creating an instance of the
ICommandProperties interface, filling some DBPROP structures and calling
ICommandProperties::SetProperties. However when I do this I get an error
on ICommandText::Execute. If I subsequently call
ICommandProperties::GetProperties with the guidPropertySet of an
DBPROPIDSET struct set to DBPROPSET_PROPERTIESINERROR it tells me that
the properties I've set are invalid. This happened regardless of the
properties I attempted to set. Out of curiosity I created a test
application that ran a select command rather than calling a stored
procedure. This ran perfectly. When I switched the logic so that it
called a parameter-less stored procedure that returned the exact same
data I got the errors again, suggesting that there is something
different you need to do for stored procedures. However this is old
technology now and I can't find any information (as well as being
something of an OleDb noob!)
Exactly which properties did you try to set?
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- Follow-Ups:
- References:
- Error adding command properties for stored procedure call
- From: andrew_k
- Error adding command properties for stored procedure call
- Prev by Date: Error adding command properties for stored procedure call
- Next by Date: c# and oledb provider for msaccess
- Previous by thread: Error adding command properties for stored procedure call
- Next by thread: Re: Error adding command properties for stored procedure call
- Index(es):
Relevant Pages
|