
Differences between SQL 6.5 & 7.0 with ADO
Yea, this happens when you use OLEDB Provider for SQL Server.
If you use OLEB Provider for ODBC, this will behave correctly without the
"Set No Count".
I have found this out myself in one of my projects, and my guess is that
OLEDB provider treat the line that reads "1 rows returned" as a recordset,
so it returns a collection of recordset, that's why the "Set Nocount On"
must be used.
If somebody from MS is here, can you please verify if this is the problem
and is this something by design?
Suriyanto
Quote:
> I ended up working this one out myself. I need to put a "set nocount on"
in
> the sp and away it went. My posted sp was just an example and the error
> would not have been duplicated by using it.
> >I'm using VB6.0 SP3 and ADO with 2 seperate projects. One is on SQL
Server
> >6.5 SP5a and the other is SQL Server 7.0 (no SP)
> >I am trying to return a value from a stored procedure as follows:
> >rs.Open "my_proc"
> >Debug.Print rs(0)
> >where my_proc is:
> >select 1
> >This works under SQL 7.0 but not SQL 6.5. I get an error on rs(0),
telling
> >me that "ADO could not find the object in the collection".
> >Does anyone have any ideas on what I'm doing wrong ?