
Stored Proc Return values / Output Params w ADO and SQL Server 7
Thanks for your response. Here is what I discovered so far.
Although I am only a lowly VB progrmammer, your C++ code did lead me to
find the following articles from MDSN:
- How to process return codes and output parameters (OLE DB)
http://msdn.microsoft.com/library/psdk/sql/olehowt1_2.htm
(Could someone who is a little more proficient in C++ than me try this
cut/paste example? I'll try it too.)
- How to process return codes and output parameters (ODBC)
http://msdn.microsoft.com/library/psdk/sql/odbcht10_2.htm
The articles above basically state that you cannot have access to the
output parameters (or return values I assume) until the rowset returned
with them has been released first. It seems this is the case because
the rowset comes first in the packet, and then the parameters after
once the rowset is released. Since ADO and OLEDB are inherently
linked, I believe that is why Microsoft suggested the workaround as
descibed in the article I referred to in my original post
(http://msdn.microsoft.com/library/psdk/sql/adoprg01_20.htm).
So in conclusion, it looks like there is no current way to access the
output parameters before closing a returned recordset. This seems
really weird to me though, and I am really suprised that no one else
has talked about this at all. Does it not seem like a logical process
to have to check a return value to know the status of the rowset (or
lack of one) being returned? Just my humble opinion.
Any further input on this topic would be greatly appreciated. Thanks.
________________________
Angelo Pacione
Quote:
> See whether the provider has enabled the feature.
> iParams = objConn.Properties("Output Parameter Availability")
> the ADO Constants are
> DBPROPVAL_OA_ATEXECUTE(2): Available immediately after Execute
> DBPROPVAL_OA_ATROWRELEASE(4): Available after releasing the rowset
> DBPROPVAL_OA_NOTSUPPORTED(1): Not Supported
> Access is 1 as it does not support output parameters at all.
> Sybase is 4, i would have been surprised if it was 2.
> I thought SQL Server would be a 2.
> check it out.
> hth
> Sent via Deja.com http://www.deja.com/
> Before you buy.
--
Sent via Deja.com http://www.deja.com/
Before you buy.