Differences between SQL 6.5 & 7.0 with ADO 
Author Message
 Differences between SQL 6.5 & 7.0 with ADO

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 ?



Fri, 31 May 2002 03:00:00 GMT  
 Differences between SQL 6.5 & 7.0 with ADO


Fri, 19 Jun 1992 00:00:00 GMT  
 Differences between SQL 6.5 & 7.0 with ADO
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.
Quote:

>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 ?



Fri, 31 May 2002 03:00:00 GMT  
 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 ?



Fri, 31 May 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Differences between SQL 6.5 & 7.0 with ADO

2. RDO error when upgrading from SQL 6.5 to SQL 7.0

3. Upsizing SQL 6.5 to SQL 7.0

4. New Transact-SQL Debugger for Microsoft SQL Server 6.5/7.0

5. USing ASP migrating from SQL 6.5 to SQL 7.0

6. Migrating from SQL 6.5 to SQL 7.0

7. SQL Debugger for Microsoft SQL Server 7.0 and 6.5

8. SQL Server 6.5 & VB6 ADO

9. ADO CONTROL & SQL 6.5 PROBLEM

10. MS SQL 6.5 / 7.0 / 2K

11. Connecting to SQL Server 6.5 and 7.0

12. SQL Server 7.0 , ADO & VB 6.0

 

 
Powered by phpBB® Forum Software